#461 - ENH: Add @Draftable support - load context

This commit is contained in:
Robin Bygrave
2015-11-23 10:07:09 +13:00
parent 7b76e13bce
commit fd9a5167b1
3 changed files with 15 additions and 3 deletions
@@ -36,6 +36,7 @@ public class DLoadContext implements LoadContext {
private final DLoadBeanContext rootBeanContext;
private final boolean asDraft;
private final Timestamp asOf;
private final Boolean readOnly;
private final boolean excludeBeanCache;
@@ -65,6 +66,7 @@ public class DLoadContext implements LoadContext {
SpiQuery<?> query = request.getQuery();
this.asOf = query.getAsOf();
this.asDraft = query.isAsDraft();
this.readOnly = query.isReadOnly();
this.disableReadAudit = query.isDisableReadAudit();
this.disableLazyLoading = query.isDisableLazyLoading();
@@ -230,6 +232,13 @@ public class DLoadContext implements LoadContext {
return asOf;
}
/**
* Return true if the root query is a 'asDraft' query that should propagate to secondary queries.
*/
protected boolean isAsDraft() {
return asDraft;
}
/**
* Return true if disable read auditing should propagate to secondary queries.
*/