use of com.infiniteautomation.mango.db.query.SQLSubQuery in project ma-core-public by infiniteautomation.
the class AbstractBasicDao method createQuery.
/**
* @param root
* @param selectCallback
* @param countCallback
* @param modelMap
* @param modifiers
* @param applyLimitToSelectSql
* @return
*/
public StreamableSqlQuery<T> createQuery(ASTNode root, StreamableRowCallback<T> selectCallback, StreamableRowCallback<Long> countCallback, Map<String, String> modelMap, Map<String, SQLColumnQueryAppender> modifiers, boolean applyLimitToSelectSql) {
SQLStatement statement;
if (useSubQuery) {
statement = new SQLSubQuery(SELECT_ALL_BASE, COUNT_BASE, joins, getTableName(), TABLE_PREFIX, applyLimitToSelectSql, Common.envProps.getBoolean("db.forceUseIndex", false), null, this.indexes, this.databaseType);
} else {
statement = new SQLStatement(SELECT_ALL_BASE, COUNT_BASE, joins, getTableName(), TABLE_PREFIX, applyLimitToSelectSql, Common.envProps.getBoolean("db.forceUseIndex", false), this.indexes, this.databaseType);
}
if (root != null)
root.accept(new RQLToSQLSelect<T>(this, modelMap, modifiers), statement);
statement.build();
return new StreamableSqlQuery<T>(this, Common.envProps.getBoolean("db.stream", false), statement, selectCallback, countCallback);
}
Aggregations