use of io.leopard.exporter.ExportSqlBuilder in project leopard by tanhaichao.
the class ExporterMysqlImpl method export.
@Override
public <T> List<T> export(Class<T> model, int start, int size) {
ExportSqlBuilder builder = new ExportSqlBuilder(model, ExportSqlBuilder.ESC_MYSQL);
String tableName = builder.getTableName();
String sql = builder.buildSql();
System.out.println(sql);
// return jdbc.queryForList(sql, model);
try {
return jdbc.getJdbcTemplate().query(sql, new ExporterLeopardBeanPropertyRowMapper<T>(model, tableName));
} catch (EmptyResultDataAccessException e) {
return null;
}
}
use of io.leopard.exporter.ExportSqlBuilder in project leopard by tanhaichao.
the class ExporterOracleImpl method export.
@Override
public <T> List<T> export(Class<T> model, int start, int size) {
ExportSqlBuilder builder = new ExportSqlBuilder(model, ExportSqlBuilder.ESC_ORACLE);
String tableName = builder.getTableName();
String sql = builder.buildSql();
System.out.println(sql);
// return jdbc.queryForList(sql, model);
try {
return jdbc.getJdbcTemplate().query(sql, new ExporterLeopardBeanPropertyRowMapper<T>(model, tableName));
} catch (EmptyResultDataAccessException e) {
return null;
}
}
Aggregations