本文整理了Java中javax.jdo.Query.getFetchPlan
方法的一些代码示例,展示了Query.getFetchPlan
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getFetchPlan
方法的具体详情如下:
包路径:javax.jdo.Query
类名称:Query
方法名:getFetchPlan
[英]Returns the FetchPlan
used by this Query
. Modifications of the returned fetch plan will not cause this query's owning PersistenceManager
's FetchPlan
to be modified.
[中]返回此Query
使用的FetchPlan
。修改返回的提取计划不会导致修改此查询的所有者PersistenceManager
的FetchPlan
。
代码示例来源:origin: stackoverflow.com
Query query = pm.newQuery(...);
// I would use of value below 1000 (gae limit)
query.getFetchPlan().setFetchSize(numberOfRecordByFetch);
代码示例来源:origin: com.mysema.querydsl/querydsl-jdo
private Query createQuery(boolean forCount) {
Expression<?> source = getSource();
// serialize
JDOQLSerializer serializer = new JDOQLSerializer(getTemplates(), source);
serializer.serialize(queryMixin.getMetadata(), forCount, false);
logQuery(serializer.toString(), serializer.getConstantToLabel());
// create Query
Query query = persistenceManager.newQuery(serializer.toString());
orderedConstants = serializer.getConstants();
queries.add(query);
if (!forCount) {
List<? extends Expression<?>> projection = queryMixin.getMetadata().getProjection();
if (projection.get(0) instanceof FactoryExpression) {
this.projection = (FactoryExpression<?>)projection.get(0);
}
if (!fetchGroups.isEmpty()) {
query.getFetchPlan().setGroups(fetchGroups);
}
if (maxFetchDepth != null) {
query.getFetchPlan().setMaxFetchDepth(maxFetchDepth);
}
}
return query;
}
内容来源于网络,如有侵权,请联系作者删除!