#210 - ENH: Add Query.setLazyLoadBatch(int size) method ... for per query control

This commit is contained in:
rbygrave
2014-11-26 20:13:30 +13:00
parent 1cd31e13b9
commit 478053263f
18 changed files with 239 additions and 112 deletions
@@ -56,7 +56,7 @@ public class DLoadContext implements LoadContext {
this.persistenceContext = request.getPersistenceContext();
this.ebeanServer = request.getServer();
this.defaultBatchSize = ebeanServer.getLazyLoadBatchSize();
this.defaultBatchSize = request.getLazyLoadBatchSize();
this.rootDescriptor = request.getBeanDescriptor();
SpiQuery<?> query = request.getQuery();
@@ -104,18 +104,13 @@ public class DLoadContext implements LoadContext {
/**
* Execute all the secondary queries.
*/
public void executeSecondaryQueries(OrmQueryRequest<?> parentRequest, int defaultQueryBatch) {
public void executeSecondaryQueries(OrmQueryRequest<?> parentRequest) {
if (secQuery != null){
for (int i = 0; i < secQuery.size(); i++) {
OrmQueryProperties properties = secQuery.get(i);
int batchSize = properties.getQueryFetchBatch();
if (batchSize == 0){
batchSize = defaultQueryBatch;
}
LoadSecondaryQuery load = getLoadSecondaryQuery(properties.getPath());
load.loadSecondaryQuery(parentRequest, batchSize, properties.isQueryFetchAll());
load.loadSecondaryQuery(parentRequest);
}
}
}
@@ -201,10 +196,6 @@ public class DLoadContext implements LoadContext {
return useAutofetchManager;
}
public String getRelativePath() {
return relativePath;
}
protected String getFullPath(String path) {
if (relativePath == null) {
return path;