#360 ENH: Add query setDisableLazyLoading(true) ... for use when graph serialised via external library (and you don't want lazy loading to fire)

This commit is contained in:
Robin Bygrave
2015-07-29 20:31:25 +12:00
parent 59d009bc94
commit 3d4bd15dac
14 changed files with 239 additions and 39 deletions
@@ -36,8 +36,9 @@ public class DLoadContext implements LoadContext {
private final Boolean readOnly;
private final boolean excludeBeanCache;
private final int defaultBatchSize;
/**
private final boolean disableLazyLoading;
/**
* The path relative to the root of the object graph.
*/
private final String relativePath;
@@ -59,7 +60,8 @@ public class DLoadContext implements LoadContext {
SpiQuery<?> query = request.getQuery();
this.asOf = query.getAsOf();
this.readOnly = query.isReadOnly();
this.readOnly = query.isReadOnly();
this.disableLazyLoading = query.isDisableLazyLoading();
this.excludeBeanCache = Boolean.FALSE.equals(query.isUseBeanCache());
this.useAutofetchManager = query.getAutoFetchManager() != null;
@@ -219,6 +221,10 @@ public class DLoadContext implements LoadContext {
return asOf;
}
protected boolean isDisableLazyLoading() {
return disableLazyLoading;
}
public PersistenceContext getPersistenceContext() {
return persistenceContext;
}