From 99203a35a2395116e1b32fc9e0a3ddbe1540b0d6 Mon Sep 17 00:00:00 2001 From: rbygrave Date: Fri, 29 May 2015 00:40:47 +1200 Subject: [PATCH] No effective change - reformat and tidy --- .../com/avaje/ebeaninternal/api/SpiQuery.java | 1133 ++++++++--------- .../ebeaninternal/server/query/CQuery.java | 3 - 2 files changed, 566 insertions(+), 570 deletions(-) diff --git a/src/main/java/com/avaje/ebeaninternal/api/SpiQuery.java b/src/main/java/com/avaje/ebeaninternal/api/SpiQuery.java index e6f7438bc..92a95ea4e 100644 --- a/src/main/java/com/avaje/ebeaninternal/api/SpiQuery.java +++ b/src/main/java/com/avaje/ebeaninternal/api/SpiQuery.java @@ -27,59 +27,60 @@ import com.avaje.ebeaninternal.server.querydefn.OrmQueryProperties; */ public interface SpiQuery extends Query { - public enum Mode { - NORMAL(false), LAZYLOAD_MANY(false), LAZYLOAD_BEAN(true), REFRESH_BEAN(true); - Mode(boolean loadContextBean) { - this.loadContextBean = loadContextBean; - } + enum Mode { + NORMAL(false), LAZYLOAD_MANY(false), LAZYLOAD_BEAN(true), REFRESH_BEAN(true); - private final boolean loadContextBean; - - public boolean isLoadContextBean() { - return loadContextBean; - } + Mode(boolean loadContextBean) { + this.loadContextBean = loadContextBean; } + private final boolean loadContextBean; + + public boolean isLoadContextBean() { + return loadContextBean; + } + } + + /** + * The type of query result. + */ + enum Type { + /** - * The type of query result. + * Find by Id or unique returning a single bean. */ - public enum Type { + BEAN, - /** - * Find by Id or unique returning a single bean. - */ - BEAN, + /** + * Find returning a List. + */ + LIST, - /** - * Find returning a List. - */ - LIST, + /** + * Find returning a Set. + */ + SET, - /** - * Find returning a Set. - */ - SET, + /** + * Find returning a Map. + */ + MAP, - /** - * Find returning a Map. - */ - MAP, + /** + * Find the Id's. + */ + ID_LIST, - /** - * Find the Id's. - */ - ID_LIST, + /** + * Find rowCount. + */ + ROWCOUNT, - /** - * Find rowCount. - */ - ROWCOUNT, - - /** - * A subquery used as part of a where clause. - */ - SUBQUERY - } + /** + * A subquery used as part of a where clause. + */ + SUBQUERY + } /** * Return the PersistenceContextScope that this query should use. @@ -87,533 +88,531 @@ public interface SpiQuery extends Query { * This can be null and in that case use the default scope. *

*/ - public PersistenceContextScope getPersistenceContextScope(); + PersistenceContextScope getPersistenceContextScope(); /** * Return the default lazy load batch size. */ - public int getLazyLoadBatchSize(); - - /** - * Return true if select all properties was used to ensure the property - * invoking a lazy load was included in the query. - */ - public boolean selectAllForLazyLoadProperty(); - - /** - * Set the query mode. - */ - public void setMode(Mode m); - - /** - * Return the query mode. - */ - public Mode getMode(); - - /** - * Return a listener that wants to be notified when the bean collection is - * first used. - */ - public BeanCollectionTouched getBeanCollectionTouched(); - - /** - * Set a listener to be notified when the bean collection has been touched - * (when the list/set/map is first used). - */ - public void setBeanCollectionTouched(BeanCollectionTouched notify); - - /** - * Set the list of Id's that is being populated. - *

- * This is a mutating list of id's and we are setting this so that other - * threads have access to the id's before the id query has finished. - *

- */ - public void setIdList(List ids); - - /** - * Return the list of Id's that is currently being fetched by a background - * thread. - */ - public List getIdList(); - - /** - * Return a copy of the query. - */ - public SpiQuery copy(); - - /** - * Return the type of query (List, Set, Map, Bean, rowCount etc). - */ - public Type getType(); - - /** - * Set the query type (List, Set etc). - */ - public void setType(Type type); - - /** - * Return a more detailed description of the lazy or query load. - */ - public String getLoadDescription(); - - /** - * Return the load mode (+lazy or +query). - */ - public String getLoadMode(); - - /** - * This becomes a lazy loading query for a many relationship. - */ - public void setLazyLoadForParents(List parentIds, BeanPropertyAssocMany many); - - /** - * Return the lazy loading 'many' property. - */ - public BeanPropertyAssocMany getLazyLoadForParentsProperty(); - - /** - * Return the list of parent Id's for lazy loading. - */ - public List getLazyLoadForParentIds(); - - /** - * Set the load mode (+lazy or +query) and the load description. - */ - public void setLoadDescription(String loadMode, String loadDescription); - - /** - * Set the BeanDescriptor for the root type of this query. - */ - public void setBeanDescriptor(BeanDescriptor desc); - - /** - * Initialise/determine the joins required to support 'many' where clause predicates. - */ - public boolean initManyWhereJoins(); - - /** - * Return the joins required to support predicates on the many properties. - */ - public ManyWhereJoins getManyWhereJoins(); - - /** - * Convert this natural key query into a find by id query. - */ - public void convertWhereNaturalKeyToId(Object idValue); - - /** - * Return a Natural Key bind parameter if supported by this query. - */ - public NaturalKeyBindParam getNaturalKeyBindParam(); - - /** - * Set the query to select the id property only. - */ - public void setSelectId(); - - /** - * Set a filter to a join path. - */ - public void setFilterMany(String prop, ExpressionList filterMany); - - /** - * Remove the query joins from query detail. - *

- * These are registered with the Load Context. - *

- */ - public List removeQueryJoins(); - - /** - * Remove the lazy joins from query detail. - *

- * These are registered with the Load Context. - *

- */ - public List removeLazyJoins(); - - /** - * Set the path of the many when +query/+lazy loading query is executed. - */ - public void setLazyLoadManyPath(String lazyLoadManyPath); - - /** - * Convert any many joins fetch joins to query joins. - */ - public void convertManyFetchJoinsToQueryJoins(boolean allowOne, int queryBatch); - - /** - * Return the TransactionContext. - *

- * If no TransactionContext is present on the query then the - * TransactionContext from the Transaction is used (transaction scoped - * persistence context). - *

- */ - public PersistenceContext getPersistenceContext(); - - /** - * Set an explicit TransactionContext (typically for a refresh query). - *

- * If no TransactionContext is present on the query then the - * TransactionContext from the Transaction is used (transaction scoped - * persistence context). - *

- */ - public void setPersistenceContext(PersistenceContext transactionContext); - - /** - * Return true if the query detail has neither select or joins specified. - */ - public boolean isDetailEmpty(); - - /** - * Return explicit autoFetch setting or null. If null then not explicitly - * set so we use the default behaviour. - */ - public Boolean isAutofetch(); - - /** - * Set to true if you want to capture executed secondary queries. - */ - public void setLogSecondaryQuery(boolean logSecondaryQuery); - - /** - * Return true if executed secondary queries should be captured. - */ - public boolean isLogSecondaryQuery(); - - /** - * Return the list of secondary queries that were executed. - */ - public List> getLoggedSecondaryQueries(); - - /** - * Log an executed secondary query. - */ - public void logSecondaryQuery(SpiQuery query); - - /** - * If return null then no autoFetch profiling for this query. If a - * AutoFetchManager is returned this implies that profiling is turned on for - * this query (and all the objects this query creates). - */ - public AutoFetchManager getAutoFetchManager(); - - /** - * This has the effect of turning on autoFetch profiling for this query. - */ - public void setAutoFetchManager(AutoFetchManager manager); - - /** - * Return the origin point for the query. - *

- * This MUST be call prior to a query being changed via tuning. This is - * because the queryPlanHash is used to identify the query point. - *

- */ - public ObjectGraphNode setOrigin(CallStack callStack); - - /** - * Set the profile point of the bean or collection that is lazy loading. - *

- * This enables use to hook this back to the original 'root' query by the - * queryPlanHash and stackPoint. - *

- */ - public void setParentNode(ObjectGraphNode node); - - /** - * Set the property that invoked the lazy load and MUST be included in the - * lazy loading query. - */ - public void setLazyLoadProperty(String lazyLoadProperty); - - /** - * Return the property that invoked lazy load. - */ - public String getLazyLoadProperty(); - - /** - * Return the lazy load path. - */ - public String getLazyLoadManyPath(); - - /** - * Used to hook back a lazy loading query to the original query (query - * point). - *

- * This will return null or an "original" query. - *

- */ - public ObjectGraphNode getParentNode(); - - /** - * Return false when this is a lazy load or refresh query for a bean. - *

- * We just take/copy the data from those beans and don't collect autoFetch - * usage profiling on those lazy load or refresh beans. - *

- */ - public boolean isUsageProfiling(); - - /** - * Set to false if this query should not be included in the autoFetch usage - * profiling information. - */ - public void setUsageProfiling(boolean usageProfiling); - - /** - * Return the query name. - */ - public String getName(); - - /** - * Calculate a hash used by AutoFetch to identify when a query has changed - * (and hence potentially needs a new tuned query plan to be developed). - *

- * Excludes bind values and occurs prior to AutoFetch potentially - * tuning/modifying the query. - *

- */ - public HashQueryPlan queryAutofetchHash(HashQueryPlanBuilder builder); - - /** - * Identifies queries that are the same bar the bind variables. - *

- * This is used AFTER AutoFetch has potentially tuned the query. This is - * used to identify and reused query plans (the final SQL string and - * associated SqlTree object). - *

- *

- * Excludes the actual bind values (as they don't effect the query plan). - *

- */ - public HashQueryPlan queryPlanHash(BeanQueryRequest request); - - /** - * Calculate a hash based on the bind values used in the query. - *

- * Combined with queryPlanHash() to return getQueryHash (a unique hash for a - * query). - *

- */ - public int queryBindHash(); - - /** - * Identifies queries that are exactly the same including bind variables. - */ - public HashQuery queryHash(); - - /** - * Return true if this is a query based on a SqlSelect rather than - * generated. - */ - public boolean isSqlSelect(); - - /** - * Return true if this is a RawSql query. - */ - public boolean isRawSql(); - - /** - * Return the Order By clause or null if there is none defined. - */ - public OrderBy getOrderBy(); - - /** - * Return additional where clause. This should be added to any where clause - * that was part of the original query. - */ - public String getAdditionalWhere(); - - /** - * Can return null if no expressions where added to the where clause. - */ - public SpiExpressionList getWhereExpressions(); - - /** - * Can return null if no expressions where added to the having clause. - */ - public SpiExpressionList getHavingExpressions(); - - /** - * Return additional having clause. Where raw String expressions are added - * to having clause rather than Expression objects. - */ - public String getAdditionalHaving(); - - /** - * Returns true if either firstRow or maxRows has been set. - */ - public boolean hasMaxRowsOrFirstRow(); - - /** - * Return true if this query should use/check the bean cache. - */ - public Boolean isUseBeanCache(); - - /** - * Return true if this query should use/check the query cache. - */ - public boolean isUseQueryCache(); - - /** - * Return true if the beans from this query should be loaded into the bean - * cache. - */ - public boolean isLoadBeanCache(); - - /** - * Return true if the beans returned by this query should be read only. - */ - public Boolean isReadOnly(); - - /** - * Adds this bean to the persistence context prior to executing the query. - */ - public void contextAdd(EntityBean bean); - - /** - * Return the type of beans queries. - */ - public Class getBeanType(); - - /** - * Return the query timeout. - */ - public int getTimeout(); - - /** - * Return the objects that should be added to the persistence context prior - * to executing the query. - */ - public ArrayList getContextAdditions(); - - /** - * Return the bind parameters. - */ - public BindParams getBindParams(); - - /** - * Get the orm query as a String. Only available if the query was built from - * a string. - */ - public String getQuery(); - - /** - * Replace the query detail. This is used by the autoFetch feature to as a - * fast way to set the query properties and joins. - *

- * Note care must be taken to keep the where, orderBy, firstRows and maxRows - * held in the detail attributes. - *

- */ - public void setDetail(OrmQueryDetail detail); - - /** - * Autofetch tune the detail specifying properties to select on already defined joins - * and adding extra joins where they are missing. - */ - public boolean tuneFetchProperties(OrmQueryDetail detail); - - /** - * Set to true if this query has been tuned by autoFetch. - */ - public void setAutoFetchTuned(boolean autoFetchTuned); - - /** - * Return the query detail. - */ - public OrmQueryDetail getDetail(); - - public TableJoin getIncludeTableJoin(); - - public void setIncludeTableJoin(TableJoin includeTableJoin); - - /** - * Return the property used to specify keys for a map. - */ - public String getMapKey(); - - /** - * Return the maximum number of rows to return in the query. - */ - public int getMaxRows(); - - /** - * Return the index of the first row to return in the query. - */ - public int getFirstRow(); - - /** - * Internally set by Ebean when this query must use the DISTINCT keyword. - *

- * This does not exclude/remove the use of the id property. - */ - public Query setSqlDistinct(boolean sqlDistinct); - - /** - * Return true if this query has been specified by a user or internally by Ebean to use DISTINCT. - */ - public boolean isDistinctQuery(); - - /** - * Return true if this query has been specified by a user to use DISTINCT. - */ - public boolean isDistinct(); - - /** - * Set default select clauses where none have been explicitly defined. - */ - public void setDefaultSelectClause(); - - /** - * Return the where clause from a parsed string query. - */ - public String getRawWhereClause(); - - /** - * Return the Id value. - */ - public Object getId(); - - /** - * Set the generated sql for debug purposes. - * - * @param generatedSql - */ - public void setGeneratedSql(String generatedSql); - - /** - * Return the hint for Statement.setFetchSize(). - */ - public int getBufferFetchSizeHint(); - - /** - * Return true if this is a query executing in the background. - */ - public boolean isFutureFetch(); - - /** - * Set to true to indicate the query is executing in a background thread - * asynchronously. - */ - public void setFutureFetch(boolean futureFetch); - - /** - * Set the underlying cancelable query (with the PreparedStatement). - */ - public void setCancelableQuery(CancelableQuery cancelableQuery); - - /** - * Return true if this query has been cancelled. - */ - public boolean isCancelled(); - - /** - * Return root table alias set by {@link #alias(String)} command. - */ - public String getAlias(); + int getLazyLoadBatchSize(); + + /** + * Return true if select all properties was used to ensure the property + * invoking a lazy load was included in the query. + */ + boolean selectAllForLazyLoadProperty(); + + /** + * Set the query mode. + */ + void setMode(Mode m); + + /** + * Return the query mode. + */ + Mode getMode(); + + /** + * Return a listener that wants to be notified when the bean collection is + * first used. + */ + BeanCollectionTouched getBeanCollectionTouched(); + + /** + * Set a listener to be notified when the bean collection has been touched + * (when the list/set/map is first used). + */ + void setBeanCollectionTouched(BeanCollectionTouched notify); + + /** + * Set the list of Id's that is being populated. + *

+ * This is a mutating list of id's and we are setting this so that other + * threads have access to the id's before the id query has finished. + *

+ */ + void setIdList(List ids); + + /** + * Return the list of Id's that is currently being fetched by a background + * thread. + */ + List getIdList(); + + /** + * Return a copy of the query. + */ + SpiQuery copy(); + + /** + * Return the type of query (List, Set, Map, Bean, rowCount etc). + */ + Type getType(); + + /** + * Set the query type (List, Set etc). + */ + void setType(Type type); + + /** + * Return a more detailed description of the lazy or query load. + */ + String getLoadDescription(); + + /** + * Return the load mode (+lazy or +query). + */ + String getLoadMode(); + + /** + * This becomes a lazy loading query for a many relationship. + */ + void setLazyLoadForParents(List parentIds, BeanPropertyAssocMany many); + + /** + * Return the lazy loading 'many' property. + */ + BeanPropertyAssocMany getLazyLoadForParentsProperty(); + + /** + * Return the list of parent Id's for lazy loading. + */ + List getLazyLoadForParentIds(); + + /** + * Set the load mode (+lazy or +query) and the load description. + */ + void setLoadDescription(String loadMode, String loadDescription); + + /** + * Set the BeanDescriptor for the root type of this query. + */ + void setBeanDescriptor(BeanDescriptor desc); + + /** + * Initialise/determine the joins required to support 'many' where clause predicates. + */ + boolean initManyWhereJoins(); + + /** + * Return the joins required to support predicates on the many properties. + */ + ManyWhereJoins getManyWhereJoins(); + + /** + * Convert this natural key query into a find by id query. + */ + void convertWhereNaturalKeyToId(Object idValue); + + /** + * Return a Natural Key bind parameter if supported by this query. + */ + NaturalKeyBindParam getNaturalKeyBindParam(); + + /** + * Set the query to select the id property only. + */ + void setSelectId(); + + /** + * Set a filter to a join path. + */ + void setFilterMany(String prop, ExpressionList filterMany); + + /** + * Remove the query joins from query detail. + *

+ * These are registered with the Load Context. + *

+ */ + List removeQueryJoins(); + + /** + * Remove the lazy joins from query detail. + *

+ * These are registered with the Load Context. + *

+ */ + List removeLazyJoins(); + + /** + * Set the path of the many when +query/+lazy loading query is executed. + */ + void setLazyLoadManyPath(String lazyLoadManyPath); + + /** + * Convert any many joins fetch joins to query joins. + */ + void convertManyFetchJoinsToQueryJoins(boolean allowOne, int queryBatch); + + /** + * Return the TransactionContext. + *

+ * If no TransactionContext is present on the query then the + * TransactionContext from the Transaction is used (transaction scoped + * persistence context). + *

+ */ + PersistenceContext getPersistenceContext(); + + /** + * Set an explicit TransactionContext (typically for a refresh query). + *

+ * If no TransactionContext is present on the query then the + * TransactionContext from the Transaction is used (transaction scoped + * persistence context). + *

+ */ + void setPersistenceContext(PersistenceContext transactionContext); + + /** + * Return true if the query detail has neither select or joins specified. + */ + boolean isDetailEmpty(); + + /** + * Return explicit autoFetch setting or null. If null then not explicitly + * set so we use the default behaviour. + */ + Boolean isAutofetch(); + + /** + * Set to true if you want to capture executed secondary queries. + */ + void setLogSecondaryQuery(boolean logSecondaryQuery); + + /** + * Return true if executed secondary queries should be captured. + */ + boolean isLogSecondaryQuery(); + + /** + * Return the list of secondary queries that were executed. + */ + List> getLoggedSecondaryQueries(); + + /** + * Log an executed secondary query. + */ + void logSecondaryQuery(SpiQuery query); + + /** + * If return null then no autoFetch profiling for this query. If a + * AutoFetchManager is returned this implies that profiling is turned on for + * this query (and all the objects this query creates). + */ + AutoFetchManager getAutoFetchManager(); + + /** + * This has the effect of turning on autoFetch profiling for this query. + */ + void setAutoFetchManager(AutoFetchManager manager); + + /** + * Return the origin point for the query. + *

+ * This MUST be call prior to a query being changed via tuning. This is + * because the queryPlanHash is used to identify the query point. + *

+ */ + ObjectGraphNode setOrigin(CallStack callStack); + + /** + * Set the profile point of the bean or collection that is lazy loading. + *

+ * This enables use to hook this back to the original 'root' query by the + * queryPlanHash and stackPoint. + *

+ */ + void setParentNode(ObjectGraphNode node); + + /** + * Set the property that invoked the lazy load and MUST be included in the + * lazy loading query. + */ + void setLazyLoadProperty(String lazyLoadProperty); + + /** + * Return the property that invoked lazy load. + */ + String getLazyLoadProperty(); + + /** + * Return the lazy load path. + */ + String getLazyLoadManyPath(); + + /** + * Used to hook back a lazy loading query to the original query (query + * point). + *

+ * This will return null or an "original" query. + *

+ */ + ObjectGraphNode getParentNode(); + + /** + * Return false when this is a lazy load or refresh query for a bean. + *

+ * We just take/copy the data from those beans and don't collect autoFetch + * usage profiling on those lazy load or refresh beans. + *

+ */ + boolean isUsageProfiling(); + + /** + * Set to false if this query should not be included in the autoFetch usage + * profiling information. + */ + void setUsageProfiling(boolean usageProfiling); + + /** + * Return the query name. + */ + String getName(); + + /** + * Calculate a hash used by AutoFetch to identify when a query has changed + * (and hence potentially needs a new tuned query plan to be developed). + *

+ * Excludes bind values and occurs prior to AutoFetch potentially + * tuning/modifying the query. + *

+ */ + HashQueryPlan queryAutofetchHash(HashQueryPlanBuilder builder); + + /** + * Identifies queries that are the same bar the bind variables. + *

+ * This is used AFTER AutoFetch has potentially tuned the query. This is + * used to identify and reused query plans (the final SQL string and + * associated SqlTree object). + *

+ *

+ * Excludes the actual bind values (as they don't effect the query plan). + *

+ */ + HashQueryPlan queryPlanHash(BeanQueryRequest request); + + /** + * Calculate a hash based on the bind values used in the query. + *

+ * Combined with queryPlanHash() to return getQueryHash (a unique hash for a + * query). + *

+ */ + int queryBindHash(); + + /** + * Identifies queries that are exactly the same including bind variables. + */ + HashQuery queryHash(); + + /** + * Return true if this is a query based on a SqlSelect rather than + * generated. + */ + boolean isSqlSelect(); + + /** + * Return true if this is a RawSql query. + */ + boolean isRawSql(); + + /** + * Return the Order By clause or null if there is none defined. + */ + OrderBy getOrderBy(); + + /** + * Return additional where clause. This should be added to any where clause + * that was part of the original query. + */ + String getAdditionalWhere(); + + /** + * Can return null if no expressions where added to the where clause. + */ + SpiExpressionList getWhereExpressions(); + + /** + * Can return null if no expressions where added to the having clause. + */ + SpiExpressionList getHavingExpressions(); + + /** + * Return additional having clause. Where raw String expressions are added + * to having clause rather than Expression objects. + */ + String getAdditionalHaving(); + + /** + * Returns true if either firstRow or maxRows has been set. + */ + boolean hasMaxRowsOrFirstRow(); + + /** + * Return true if this query should use/check the bean cache. + */ + Boolean isUseBeanCache(); + + /** + * Return true if this query should use/check the query cache. + */ + boolean isUseQueryCache(); + + /** + * Return true if the beans from this query should be loaded into the bean + * cache. + */ + boolean isLoadBeanCache(); + + /** + * Return true if the beans returned by this query should be read only. + */ + Boolean isReadOnly(); + + /** + * Adds this bean to the persistence context prior to executing the query. + */ + void contextAdd(EntityBean bean); + + /** + * Return the type of beans queries. + */ + Class getBeanType(); + + /** + * Return the query timeout. + */ + int getTimeout(); + + /** + * Return the objects that should be added to the persistence context prior + * to executing the query. + */ + ArrayList getContextAdditions(); + + /** + * Return the bind parameters. + */ + BindParams getBindParams(); + + /** + * Get the orm query as a String. Only available if the query was built from + * a string. + */ + String getQuery(); + + /** + * Replace the query detail. This is used by the autoFetch feature to as a + * fast way to set the query properties and joins. + *

+ * Note care must be taken to keep the where, orderBy, firstRows and maxRows + * held in the detail attributes. + *

+ */ + void setDetail(OrmQueryDetail detail); + + /** + * Autofetch tune the detail specifying properties to select on already defined joins + * and adding extra joins where they are missing. + */ + boolean tuneFetchProperties(OrmQueryDetail detail); + + /** + * Set to true if this query has been tuned by autoFetch. + */ + void setAutoFetchTuned(boolean autoFetchTuned); + + /** + * Return the query detail. + */ + OrmQueryDetail getDetail(); + + TableJoin getIncludeTableJoin(); + + void setIncludeTableJoin(TableJoin includeTableJoin); + + /** + * Return the property used to specify keys for a map. + */ + String getMapKey(); + + /** + * Return the maximum number of rows to return in the query. + */ + int getMaxRows(); + + /** + * Return the index of the first row to return in the query. + */ + int getFirstRow(); + + /** + * Internally set by Ebean when this query must use the DISTINCT keyword. + *

+ * This does not exclude/remove the use of the id property. + */ + Query setSqlDistinct(boolean sqlDistinct); + + /** + * Return true if this query has been specified by a user or internally by Ebean to use DISTINCT. + */ + boolean isDistinctQuery(); + + /** + * Return true if this query has been specified by a user to use DISTINCT. + */ + boolean isDistinct(); + + /** + * Set default select clauses where none have been explicitly defined. + */ + void setDefaultSelectClause(); + + /** + * Return the where clause from a parsed string query. + */ + String getRawWhereClause(); + + /** + * Return the Id value. + */ + Object getId(); + + /** + * Set the generated sql for debug purposes. + */ + void setGeneratedSql(String generatedSql); + + /** + * Return the hint for Statement.setFetchSize(). + */ + int getBufferFetchSizeHint(); + + /** + * Return true if this is a query executing in the background. + */ + boolean isFutureFetch(); + + /** + * Set to true to indicate the query is executing in a background thread + * asynchronously. + */ + void setFutureFetch(boolean futureFetch); + + /** + * Set the underlying cancelable query (with the PreparedStatement). + */ + void setCancelableQuery(CancelableQuery cancelableQuery); + + /** + * Return true if this query has been cancelled. + */ + boolean isCancelled(); + + /** + * Return root table alias set by {@link #alias(String)} command. + */ + String getAlias(); } diff --git a/src/main/java/com/avaje/ebeaninternal/server/query/CQuery.java b/src/main/java/com/avaje/ebeaninternal/server/query/CQuery.java index de1c4f235..d1c49b734 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/query/CQuery.java +++ b/src/main/java/com/avaje/ebeaninternal/server/query/CQuery.java @@ -2,7 +2,6 @@ package com.avaje.ebeaninternal.server.query; import com.avaje.ebean.QueryIterator; import com.avaje.ebean.bean.*; -import com.avaje.ebeaninternal.api.SpiExpressionList; import com.avaje.ebeaninternal.api.SpiQuery; import com.avaje.ebeaninternal.api.SpiQuery.Mode; import com.avaje.ebeaninternal.api.SpiTransaction; @@ -11,9 +10,7 @@ import com.avaje.ebeaninternal.server.core.Message; import com.avaje.ebeaninternal.server.core.OrmQueryRequest; import com.avaje.ebeaninternal.server.core.SpiOrmQueryRequest; import com.avaje.ebeaninternal.server.deploy.*; -import com.avaje.ebeaninternal.server.el.ElPropertyValue; import com.avaje.ebeaninternal.server.lib.util.StringHelper; -import com.avaje.ebeaninternal.server.querydefn.OrmQueryProperties; import com.avaje.ebeaninternal.server.type.DataBind; import com.avaje.ebeaninternal.server.type.DataReader; import org.slf4j.Logger;