mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user