#667 - Remove deprecated @SqlSelect ... migrate to use RawSql / RawSqlBuilder

This commit is contained in:
Robin Bygrave committed 2016-04-27 08:40:00 +12:00
1 parent 7b8d2a2f9d
commit fc748ea9c1
4 files changed
+6 -346

No files matched your search

@@ -1,7 +1,5 @@
package com.avaje.ebeaninternal.server.deploy;
import com.avaje.ebean.annotation.SqlSelect;
/**
* Meta data for a sql-select object.
* <p>
@@ -19,18 +17,6 @@ public class DRawSqlMeta {
private String having;
private String columnMapping;
public DRawSqlMeta(SqlSelect sqlSelect) {
this.debug = sqlSelect.debug();
this.name = sqlSelect.name();
this.tableAlias = toNull(sqlSelect.tableAlias());
this.extend = toNull(sqlSelect.extend());
this.having = toNull(sqlSelect.having());
this.where = toNull(sqlSelect.where());
this.columnMapping = toNull(sqlSelect.columnMapping());
this.query = toNull(sqlSelect.query());
}
public DRawSqlMeta(String name, String extend, String query, boolean debug,
String where, String having, String columnMapping) {
@@ -129,11 +115,4 @@ public class DRawSqlMeta {
}
}
private static String toNull(String s) {
if (s != null && s.equals("")){
return null;
} else {
return s;
}
}
}
@@ -1,8 +1,7 @@
package com.avaje.ebeaninternal.server.deploy.parse;
import com.avaje.ebean.annotation.Sql;
import com.avaje.ebean.annotation.SqlSelect;
import com.avaje.ebeaninternal.server.deploy.DRawSqlMeta;
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
/**
* Read the class level deployment annotations.
@@ -17,25 +16,8 @@ public class AnnotationSql extends AnnotationParser {
Class<?> cls = descriptor.getBeanType();
Sql sql = cls.getAnnotation(Sql.class);
if (sql != null) {
setSql(sql);
}
SqlSelect sqlSelect = cls.getAnnotation(SqlSelect.class);
if (sqlSelect != null) {
setSqlSelect(sqlSelect);
descriptor.setEntityType(BeanDescriptor.EntityType.SQL);
}
}
private void setSql(Sql sql) {
SqlSelect[] select = sql.select();
for (int i = 0; i < select.length; i++) {
setSqlSelect(select[i]);
}
}
private void setSqlSelect(SqlSelect sqlSelect) {
DRawSqlMeta rawSqlMeta = new DRawSqlMeta(sqlSelect);
descriptor.add(rawSqlMeta);
}
}