diff --git a/ebean-querybean/src/main/java/io/ebean/typequery/TQRootBean.java b/ebean-querybean/src/main/java/io/ebean/typequery/TQRootBean.java index 113dd16ec..38bc4d52f 100644 --- a/ebean-querybean/src/main/java/io/ebean/typequery/TQRootBean.java +++ b/ebean-querybean/src/main/java/io/ebean/typequery/TQRootBean.java @@ -68,6 +68,11 @@ public abstract class TQRootBean { */ private final Query query; + /** + * The root query bean instance. Used to provide fluid query construction. + */ + private final R root; + /** * The underlying expression lists held as a stack. Pushed and popped based on and/or (conjunction/disjunction). */ @@ -84,11 +89,6 @@ public abstract class TQRootBean { */ private boolean textMode; - /** - * The root query bean instance. Used to provide fluid query construction. - */ - private R root; - /** * Construct using the type of bean to query on and the default database. */ @@ -134,11 +134,13 @@ public abstract class TQRootBean { */ public TQRootBean(boolean aliasDummy) { this.query = null; + this.root = null; } /** Construct for FilterMany */ protected TQRootBean(ExpressionList filter) { this.query = null; + this.root = null; this.whereStack = new ArrayStack<>(); whereStack.push(filter); } @@ -150,13 +152,6 @@ public abstract class TQRootBean { return ((SpiFetchGroupQuery) query()).buildFetchGroup(); } - /** - * Sets the root query bean instance. Used to provide fluid query construction. - */ - protected void setRoot(R root) { - this.root = root; - } - /** * Return the underlying query. *