本文整理了Java中com.psddev.dari.db.Query.setSorters
方法的一些代码示例,展示了Query.setSorters
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setSorters
方法的具体详情如下:
包路径:com.psddev.dari.db.Query
类名称:Query
方法名:setSorters
[英]Sets the list of sorters applied to the result.
[中]设置应用于结果的分类器列表。
代码示例来源:origin: perfectsense/brightspot-cms
private void addLegacyDatabaseSupport(Query query) {
boolean usesLegacyDatabase = false;
Database database = query.getDatabase();
while (database instanceof ForwardingDatabase) {
database = ((ForwardingDatabase) database).getDelegate();
}
if (database instanceof SqlDatabase) {
usesLegacyDatabase = true;
} else if (database instanceof AggregateDatabase) {
usesLegacyDatabase = ((AggregateDatabase) database).getDelegatesByClass(SqlDatabase.class).size() > 0;
}
if (usesLegacyDatabase) {
query.getOptions().put(SqlDatabase.USE_JDBC_FETCH_SIZE_QUERY_OPTION, false);
query.setSorters(null); // SqlDatabase#ByIdIterator does not support sorters
}
}
代码示例来源:origin: perfectsense/dari
@Override
public Query<E> clone() {
Query<E> clone = new Query<E>(group, objectClass);
clone.setPredicate(predicate);
clone.setSorters(sorters != null ? new ArrayList<Sorter>(sorters) : null);
clone.setFields(fields != null ? new ArrayList<String>(fields) : null);
clone.setDatabase(database);
clone.setResolveToReferenceOnly(isResolveToReferenceOnly);
clone.setCache(!noCache);
clone.setMaster(master);
clone.setResolveInvisible(resolveInvisible);
clone.setTimeout(timeout);
clone.setOptions(options != null ? new HashMap<String, Object>(options) : null);
return clone;
}
内容来源于网络,如有侵权,请联系作者删除!