use of com.ctrip.platform.dal.daogen.entity.GenTaskBySqlBuilder in project dal by ctripcorp.
the class DaoBySqlBuilder method updateAndGetAllTasks.
public List<GenTaskBySqlBuilder> updateAndGetAllTasks(int projectId) throws SQLException {
List<GenTaskBySqlBuilder> result = new ArrayList<>();
List<GenTaskBySqlBuilder> list = getTasksByProjectId(projectId);
if (list == null || list.isEmpty())
return result;
for (GenTaskBySqlBuilder entity : list) {
entity.setGenerated(true);
result.add(entity);
}
return result;
}
use of com.ctrip.platform.dal.daogen.entity.GenTaskBySqlBuilder in project dal by ctripcorp.
the class DaoBySqlBuilder method getAllTasks.
public List<GenTaskBySqlBuilder> getAllTasks() throws SQLException {
DalHints hints = DalHints.createIfAbsent(null);
SelectSqlBuilder builder = new SelectSqlBuilder().selectAll();
List<GenTaskBySqlBuilder> list = client.query(builder, hints);
processList(list);
return list;
}
use of com.ctrip.platform.dal.daogen.entity.GenTaskBySqlBuilder in project dal by ctripcorp.
the class DaoBySqlBuilder method getTasksByProjectId.
public List<GenTaskBySqlBuilder> getTasksByProjectId(int projectId) throws SQLException {
FreeSelectSqlBuilder<List<GenTaskBySqlBuilder>> builder = new FreeSelectSqlBuilder<>(dbCategory);
StringBuilder sb = new StringBuilder();
sb.append("SELECT id, project_id,db_name, table_name,class_name,method_name,sql_style,crud_type,fields,where_condition,sql_content,`generated`,version,update_user_no,update_time,comment,scalarType,pagination,orderby,approved,approveMsg,hints ");
sb.append("FROM task_auto WHERE project_id=? order by id ");
builder.setTemplate(sb.toString());
StatementParameters parameters = new StatementParameters();
int i = 1;
parameters.set(i++, "project_id", Types.INTEGER, projectId);
builder.mapWith(genTaskBySqlBuilderRowMapper);
DalHints hints = DalHints.createIfAbsent(null).allowPartial();
List<GenTaskBySqlBuilder> list = queryDao.query(builder, parameters, hints);
processList(list);
return list;
}
Aggregations