use of org.nutz.dao.impl.entity.macro.SqlFieldMacro in project nutz by nutzam.
the class GBaseJdbcExpert method fetchPojoId.
public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
String autoSql = "SELECT @@@@IDENTITY";
Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
autoInfo.setEntity(en);
return autoInfo;
}
use of org.nutz.dao.impl.entity.macro.SqlFieldMacro in project nutz by nutzam.
the class H2JdbcExpert method fetchPojoId.
public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
String autoSql = "SELECT IDENTITY() as $field from $view";
Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
autoInfo.setEntity(en);
return autoInfo;
}
use of org.nutz.dao.impl.entity.macro.SqlFieldMacro in project nutz by nutzam.
the class DerbyJdbcExpert method fetchPojoId.
public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
String autoSql = "select IDENTITY_VAL_LOCAL() as id from " + en.getTableName();
Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
autoInfo.setEntity(en);
return autoInfo;
}
use of org.nutz.dao.impl.entity.macro.SqlFieldMacro in project nutz by nutzam.
the class SQLiteJdbcExpert method fetchPojoId.
public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
String autoSql = "SELECT MAX($field) AS $field FROM $view";
Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
autoInfo.setEntity(en);
return autoInfo;
}
use of org.nutz.dao.impl.entity.macro.SqlFieldMacro in project nutz by nutzam.
the class AbstractJdbcExpert method fetchPojoId.
public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
String autoSql = "SELECT MAX($field) AS $field FROM $view";
Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
autoInfo.setEntity(en);
return autoInfo;
}
Aggregations