mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#210 - ENH: Add Query.setLazyLoadBatch(int size) method ... for per query control
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user