From c849e293164f5779dc2c73ef528bff30337b4a09 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Fri, 2 Feb 2024 14:43:31 +1300 Subject: [PATCH] Tidy OrmQueryRequest isReadOnly, just use query.isReadOnly instead --- .../io/ebeaninternal/server/core/OrmQueryRequest.java | 9 --------- .../main/java/io/ebeaninternal/server/query/CQuery.java | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/core/OrmQueryRequest.java b/ebean-core/src/main/java/io/ebeaninternal/server/core/OrmQueryRequest.java index 3dfca446b3..1b5a1952d3 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/core/OrmQueryRequest.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/core/OrmQueryRequest.java @@ -35,7 +35,6 @@ public final class OrmQueryRequest extends BeanRequest implements SpiOrmQuery private final OrmQueryEngine queryEngine; private final SpiQuery query; private final BeanFindController finder; - private final Boolean readOnly; private LoadContext loadContext; private PersistenceContext persistenceContext; private HashQuery cacheKey; @@ -52,7 +51,6 @@ public OrmQueryRequest(SpiEbeanServer server, OrmQueryEngine queryEngine, SpiQue this.finder = beanDescriptor.beanFinder(); this.queryEngine = queryEngine; this.query = query; - this.readOnly = query.isReadOnly(); this.persistenceContext = query.persistenceContext(); } @@ -135,13 +133,6 @@ public int secondaryQueriesMinBatchSize() { return loadContext.secondaryQueriesMinBatchSize(); } - /** - * Return the Normal, sharedInstance, ReadOnly state of this query. - */ - public Boolean isReadOnly() { - return readOnly; - } - /** * Return the BeanDescriptor for the associated bean. */ diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/query/CQuery.java b/ebean-core/src/main/java/io/ebeaninternal/server/query/CQuery.java index d3804e1412..85d6319e9d 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/query/CQuery.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/query/CQuery.java @@ -186,7 +186,7 @@ public CQuery(OrmQueryRequest request, CQueryPredicates predicates, CQueryPla this.queryMode = query.mode(); this.loadContextBean = queryMode.isLoadContextBean() || query.getForUpdateLockType() != null; this.lazyLoadManyProperty = query.lazyLoadMany(); - this.readOnly = request.isReadOnly(); + this.readOnly = query.isReadOnly(); this.disableLazyLoading = query.isDisableLazyLoading(); this.objectGraphNode = query.parentNode(); this.profilingListener = query.profilingListener();