Purpose: Abstract class for all read queries using objects.
Description: Contains common behavior for all read queries using objects.
| Modifier and Type | Field and Description |
|---|---|
| protected List | additionalFields
Allow for additional fields to be selected, used for m-m batch reading. |
| protected Map | aggregateQueries
Allow aggregate queries to be prepared and cached. |
| protected BatchFetchPolicy | batchFetchPolicy
Defines batch fetching configuration. |
| protected int | cacheUsage
Allow for the cache usage to be specified to enable in-memory querying. |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| protected Map | concreteSubclassCalls
Allow concrete subclasses calls to be prepared and cached for inheritance queries. |
| protected Map | concreteSubclassJoinedMappingIndexes
Allow concrete subclasses joined mapping indexes to be prepared and cached for inheritance queries. |
| protected Map | concreteSubclassQueries
Allow concrete subclasses queries to be prepared and cached for inheritance queries. |
| public static final int | |
| protected ExpressionBuilder | defaultBuilder
Provide a default builder so that it's easier to be consistent |
| protected short | distinctState
Indicates if distinct should be used or not. |
| public static final int | |
| public static final short | |
| protected FetchGroup | fetchGroup
|
| protected String | fetchGroupName
Name of |
| protected int | inMemoryQueryIndirectionPolicy
Used to determine behavior of indirection in in-memory querying and conforming. |
| protected boolean | isCachedExpressionQuery
Indicates whether the query is cached as an expression query in descriptor's query manager. |
| protected boolean | isPrePrepared
Allow a prePrepare stage to build the expression for EJBQL and QBE and resolve joining. |
| protected boolean | isReadOnly
PERF: Allow queries to be defined as read-only in unit of work execution. |
| protected Boolean | isReferenceClassLocked
PERF: Caches locking policy isReferenceClassLocked setting. |
| protected Boolean | isResultSetAccessOptimizedQuery
PERF: Allow queries to build while accessing the database result-set. |
| public static boolean | isResultSetAccessOptimizedQueryDefault
If neither query specifies isResultSetOptimizedQuery nor session specifies shouldOptimizeResultSetAccess then this value is used to indicate whether optimization should be attempted |
| protected boolean | isResultSetOptimizedQuery
PERF: Allow queries to build directly from the database result-set. |
| protected JoinedAttributeManager | joinedAttributeManager
Stores the helper object for dealing with joined attributes |
| protected LoadGroup | loadGroup
Specifies indirection that should be instantiated before returning result |
| protected String | lockModeType
Used when specifying a lock mode for the query |
| public static final String | NONE
Names of the possible lock mode types, JPA 2.0 only |
| protected List | nonFetchJoinAttributeExpressions
Stores the non fetchjoin attributes, these are joins that will be represented in the where clause but not in the select. |
| public static final String | |
| public static final String | |
| protected List | orderByExpressions
Used for ordering support. |
| protected List | partialAttributeExpressions
Stores the partial attributes that have been added to this query |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | READ
Names of the possible lock mode types, JPA 1.0 and 2.0 |
| protected boolean | shouldExtendPessimisticLockScope
Indicates whether pessimistic lock should also be applied to relation tables (ManyToMany and OneToOne mappings), reference tables (DirectCollection and AggregateCollection mapping). |
| protected boolean | shouldIncludeData
Allow for a complex result to be return including the rows and objects, used for m-m batch reading. |
| protected Boolean | shouldOuterJoinSubclasses
Define if an outer join should be used to read subclasses. |
| protected boolean | shouldUseDefaultFetchGroup
Flag to turn on/off the use of the default fetch group. |
| protected boolean | shouldUseSerializedObjectPolicy
Indicates whether the query should use SerializedObjectPolicy if descriptor has it. |
| public static boolean | shouldUseSerializedObjectPolicyDefault
default value for shouldUseSerializedObjectPolicy |
| public static final short | |
| protected List | unionExpressions
Allow a query's results to be unioned (UNION, INTERSECT, EXCEPT) with another query results. |
| public static final short | |
| public static final int | |
| protected transient Boolean | usesResultSetAccessOptimization
PERF: Indicates whether the query is actually using ResultSet optimization. |
| protected Integer | waitTimeout
waitTimeout has three possible setting: null, 0 and 1..N null: use the session.getPessimisticLockTimeoutDefault() if available. |
| protected TimeUnit | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | acquireLocksWithoutWaiting()
PUBLIC: Set the query to lock without waiting (blocking), this will also turn refreshCache on. |
| public void | |
| public void | |
| public void | addBatchReadAttribute(String attributeName)
PUBLIC: Specify the foreign-reference mapped attribute to be optimized in this query. |
| public void | addBatchReadAttribute(Expression attributeExpression)
PUBLIC: Specify the foreign-reference mapped attribute to be optimized in this query. |
| public void | addDescendingOrdering(String queryKeyName)
PUBLIC: Order the query results by the object's attribute or query key name. |
| public void | addJoinedAttribute(String attributeName)
PUBLIC: Specify the relationship attribute to be join fetched in this query. |
| public void | addJoinedAttribute(Expression attributeExpression)
PUBLIC: Specify the attribute to be join fetched in this query. |
| public void | addJoinSelectionFields(Vector<E> fields, boolean isCustomSQL)
INTERNAL: The method adds to the passed input vector the fields or expressions corresponding to the joins. |
| public void | |
| public void | addNonFetchJoinedAttribute(String attributeName)
PUBLIC: Specify the relationship attribute to be join in this query. |
| public void | addNonFetchJoinedAttribute(Expression attributeExpression)
PUBLIC: Specify the relationship attribute to be join in this query. |
| public void | |
| public void | addPartialAttribute(String attributeName)
Deprecated
since EclipseLink 2.1, partial attributes replaced by fetch groups.
PUBLIC:
Specify that only a subset of the class' attributes be selected in this query.
|
| public void | addPartialAttribute(Expression attributeExpression)
Deprecated
since EclipseLink 2.1, partial attributes replaced by fetch groups.
PUBLIC:
Specify that only a subset of the class' attributes be selected in this query.
|
| protected void | addSelectionFieldsForJoinedExpression(List<E> fields, boolean isCustomSQL, Expression expression)
INTERNAL: The method adds to the passed input vector the fields or expressions corresponding to the passed join expression. |
| public void | |
| public Object | buildObject(AbstractRecord row)
Overrides org. |
| public void | changeDescriptor(AbstractSession theSession)
INTERNAL: The reference class has been changed, need to reset the descriptor. |
| public void | checkCacheOnly()
PUBLIC: The cache will checked completely, if the object is not found null will be returned or an error if the query is too complex. |
| protected abstract Boolean | Returns: Current custom query flag. Value shall never benull.Current session. session, final AbstractRecord Database record. translationRow)INTERNAL: Check and return custom query flag. |
| public void | checkDescriptor(AbstractSession
Current session. session)Overrides org. |
| public Object | checkEarlyReturn(AbstractSession session, AbstractRecord translationRow)
Overrides org. |
| protected abstract Object | checkEarlyReturnLocal(AbstractSession session, AbstractRecord translationRow)
INTERNAL: Contains the body of the check early return call, implemented by subclasses. |
| protected DatabaseQuery | Returns: Custom database query ornull when custom database query is not set.Current session. session, final AbstractRecord Database record. translationRow)Overrides org. |
| public void | checkPrepare(AbstractSession session, AbstractRecord translationRow, boolean force)
Overrides org. |
| public void | checkPrePrepare(AbstractSession session)
INTERNAL: ObjectLevelReadQueries now have an explicit pre-prepare stage, which is for checking for pessimistic locking, and computing any joined attributes declared on the descriptor. |
| public void | clearIsResultSetOptimizedQuery()
ADVANCED: Clear the flag set by setIsResultSetOptimizedQuery method, allow to use default set on the session instead. |
| public void | |
| public Object | Returns: A clone of this instance.Overrides org. |
| public void | |
| public void | computeBatchReadMappingQueries()
INTERNAL: Used to optimize joining by pre-computing the nested join queries for the mappings. |
| protected void | computeNestedQueriesForBatchReadExpressions(List<Expression> batchReadExpressions)
INTERNAL: This method is used when computing the nested queries for batch read mappings. |
| protected Object | Returns: a clone, or null if result does not conform.the clone to return clone, UnitOfWorkImpl current UnitOfWork unitOfWork, AbstractRecord the parameters this query was executed with arguments, Expression the expression to conform to. If was a
selection object or key, null (which all conform to) is used selectionCriteriaClone, Map<K, V> a hashtable of objects already found by scanning
the UnitOfWork cache for conforming instances. Prevents duplicates. alreadyReturned)INTERNAL: Conforms and registers an individual result. |
| public void | conformResultsInUnitOfWork()
PUBLIC: The cache will checked completely, if the object is not found the database will be queried, and the database result will be verified with what is in the cache and/or unit of work including new objects. |
| public void | copyFromQuery(DatabaseQuery query)
Overrides org. |
| public Object | deepClone()
Overrides org. |
| public void | |
| public void | |
| public void | dontRefreshIdentityMapResult()
Overrides org. |
| public void | dontRefreshRemoteIdentityMapResult()
Overrides org. |
| public void | |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides java. |
| public void | |
| public Object | Returns: An object, the result of executing the query.- the session in which the receiver will be executed. session, AbstractRecord translationRow)Overrides org. |
| public Object | executeDatabaseQuery()
Implements abstract org. |
| public Object | executeInUnitOfWork(UnitOfWorkImpl
- the session in which the receiver will be executed. unitOfWork, AbstractRecord - the arguments translationRow)Overrides org. |
| protected abstract Object | |
| protected abstract Object | |
| public void | |
| public List | |
| public Map | |
| public ObjectLevelReadQuery | getAggregateQuery(DatabaseMapping mapping)
INTERNAL: Return the aggregate query clone for the mapping. |
| public AsOfClause | Returns: An immutable object representation of the past time.null if no clause set, AsOfClause.NO_CLAUSE if
clause explicitly set to null.ADVANCED: Answers the past time this query is as of. |
| public BatchFetchPolicy | |
| public Map | getBatchObjects()
Overrides org. |
| public List | |
| public int | |
| public Map | |
| public Map | getConcreteSubclassJoinedMappingIndexes()
INTERNAL: Return the cache of concrete subclass joined mapping indexes. |
| public Map | |
| public short | |
| public Object | |
| public FetchGroup | getExecutionFetchGroup()
Overrides org. |
| public FetchGroup | getExecutionFetchGroup(ClassDescriptor descriptor)
Overrides org. |
| public ExpressionBuilder | |
| public FetchGroup | |
| public String | |
| public Set | getFetchGroupNonNestedFieldsSet()
INTERNAL: Return the set of fields required in the select clause, for fetch group reading. |
| public Set | getFetchGroupNonNestedFieldsSet(DatabaseMapping nestedMapping)
INTERNAL: Return the set of fields required in the select clause, for fetch group reading. |
| public List | getFetchGroupSelectionFields()
INTERNAL: Return the fields required in the select clause, for fetch group reading. |
| protected List | getFetchGroupSelectionFields(DatabaseMapping nestedMapping)
INTERNAL: Return the fields required in the select clause, for fetch group reading. |
| public InMemoryQueryIndirectionPolicy | getInMemoryQueryIndirectionPolicy()
PUBLIC: Returns the InMemoryQueryIndirectionPolicy for this query |
| public int | getInMemoryQueryIndirectionPolicyState()
PUBLIC: Returns the InMemoryQueryIndirectionPolicy for this query |
| public List | |
| public JoinedAttributeManager | getJoinedAttributeManager()
INTERNAL: Return join manager responsible for managing all aspects of joining for the query. |
| public LoadGroup | getLoadGroup()
Overrides org. |
| public ForUpdateClause | |
| public String | getLockModeType()
INTERNAL: returns the jakarta.persistence.LockModeType string value set on this query. |
| public List | getNonFetchJoinAttributeExpressions()
INTERNAL: Return the attributes that must be joined, but not fetched, that is, do not trigger the value holder. |
| public List | |
| public List | |
| public Vector | getPartialAttributeSelectionFields(boolean isCustomSQL)
INTERNAL: Return the fields required in the select clause, for patial attribute reading. |
| public QueryByExamplePolicy | getQueryByExamplePolicy()
PUBLIC: When using Query By Example, an instance of QueryByExamplePolicy is used to customize the query. |
| protected abstract ObjectLevelReadQuery | Returns: Custom read query from query manager.INTERNAL: Get custom read query from query manager. |
| public Class | getReferenceClass()
Overrides org. |
| public String | getReferenceClassName()
Overrides org. |
| public Vector | |
| public List | |
| public Integer | |
| public TimeUnit | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | hasExecutionFetchGroup()
Overrides org. |
| public boolean | |
| public int | hashCode()
Overrides java. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | hasPartialAttributeExpressions()
Overrides org. |
| public boolean | |
| protected void | |
| public void | |
| public boolean | isAttributeBatchRead(ClassDescriptor mappingDescriptor, String attributeName)
INTERNAL: Return if the attribute is specified for batch reading. |
| public boolean | isCachedExpressionQuery()
INTERNAL: Indicates whether the query is cached as an expression query in descriptor's query manager. |
| public boolean | isClonePessimisticLocked(Object clone, UnitOfWorkImpl uow)
Overrides org. |
| public boolean | isDefaultLock()
Overrides org. |
| public boolean | isDefaultPropertiesQuery()
Overrides org. |
| public boolean | |
| public boolean | isLockQuery()
Overrides org. |
| public boolean | |
| public boolean | isObjectLevelReadQuery()
Overrides org. |
| public boolean | |
| protected boolean | |
| public boolean | |
| public boolean | |
| protected boolean | |
| public Boolean | isResultSetAccessOptimizedQuery()
ADVANCED: Return if the query result set access should be optimized. |
| public boolean | isResultSetOptimizedQuery()
ADVANCED: Return if the query should be optimized to build directly from the result set. |
| protected void | prepare()
Overrides org. |
| public void | |
| protected void | prepareForRemoteExecution()
Overrides org. |
| protected boolean | |
| public void | prepareFromQuery(DatabaseQuery query)
Overrides org. |
| public DatabaseQuery | prepareOutsideUnitOfWork(AbstractSession session)
INTERNAL: There is a very special case where a query may be a bean-level pessimistic locking query. |
| protected void | |
| protected void | prepareResultSetAccessOptimization()
INTERNAL: Sets usesResultSetAccessOptimization based on isResultSetAccessOptimizedQuery, session default and query settings that could not be altered without re-preparing the query. |
| protected void | |
| public void | recordCloneForPessimisticLocking(Object clone, UnitOfWorkImpl uow)
Overrides org. |
| public void | refreshIdentityMapResult()
Overrides org. |
| public void | refreshRemoteIdentityMapResult()
Overrides org. |
| public abstract Object | Returns: the final (conformed, refreshed, wrapped) UnitOfWork query resultmay be collection (read all) or an object (read one),
or even a cursor. If in transaction the shared cache will
be bypassed, meaning the result may not be originals from the parent
but raw database rows. result, UnitOfWorkImpl the unitOfWork the result is being registered in. unitOfWork, AbstractRecord the original arguments/parameters passed to the query
execution. Used by conforming arguments, boolean If in transaction must construct
a registered result from raw database rows. buildDirectlyFromRows)INTERNAL: All objects queried via a UnitOfWork get registered here. |
| public void | |
| public void | setAdditionalFields(List<Object> additionalFields)
INTERNAL: Additional fields can be added to a query. |
| public void | setAggregateQuery(DatabaseMapping mapping, ObjectLevelReadQuery query)
INTERNAL: Set the aggregate query clone for the mapping. |
| public void | |
| public void | setBatchFetchPolicy(BatchFetchPolicy batchFetchPolicy)
Set the batch fetch policy for configuring batch fetching. |
| public void | |
| public void | |
| public void | setBatchObjects(Map<Object, Object> batchObjects)
Overrides org. |
| public void | setBatchReadAttributeExpressions(List<Expression> attributeExpressions)
INTERNAL: Set all attributes specified for batch reading. |
| public void | |
| public void | setDescriptor(ClassDescriptor descriptor)
Overrides org. |
| public void | setDistinctState(short distinctState)
ADVANCED: If a distinct has been set the DISTINCT clause will be printed. |
| public void | setEJBQLString(String ejbqlString)
Overrides org. |
| public void | setExampleObject(Object newExampleObject)
PUBLIC: Set the example object of the query to be the newExampleObject. |
| public void | setExpressionBuilder(ExpressionBuilder builder)
INTERNAL Sets the default expression builder for this query. |
| public void | |
| public void | setFetchGroupName(String groupName)
Set a descriptor-level pre-defined named fetch group to the query. |
| public void | setInMemoryQueryIndirectionPolicy(InMemoryQueryIndirectionPolicy inMemoryQueryIndirectionPolicy)
PUBLIC: Set the InMemoryQueryIndirectionPolicy for this query. |
| public void | setInMemoryQueryIndirectionPolicyState(int inMemoryQueryIndirectionPolicy)
PUBLIC: Set the InMemoryQueryIndirectionPolicy for this query. |
| public void | setIsPrepared(boolean isPrepared)
Overrides org. |
| protected void | |
| public void | setIsPrePrepared(boolean isPrePrepared)
INTERNAL: If changes are made to the query that affect the derived SQL or Call parameters the query needs to be prepared again. |
| public void | |
| public void | setIsResultSetAccessOptimizedQuery(boolean isResultSetAccessOptimizedQuery)
ADVANCED: Set if the query should be optimized to build directly from the result set. |
| public void | setIsResultSetOptimizedQuery(boolean isResultSetOptimizedQuery)
ADVANCED: Set if the query should be optimized to build directly from the result set. |
| public void | |
| public void | setJoinedAttributeManager(JoinedAttributeManager joinedAttributeManager)
INTERNAL: Set join manager responsible for managing all aspects of joining for the query. |
| public void | |
| public void | setLockingClause(ForUpdateClause clause)
INTERNAL: The locking clause contains a list of expressions representing which objects are to be locked by the query. |
| public void | setLockMode(short lockMode)
Overrides org. |
| public boolean | Returns: returns a failure flag indicating that we were UNABLE to set the lock mode because of validation. Callers to this method should check the return value and throw the necessary exception.INTERNAL: Sets a jakarta.persistence.LockModeType to used with this queries execution. |
| public void | setNonFetchJoinAttributeExpressions(List<Expression> nonFetchJoinExpressions)
INTERNAL: Return the attributes that must be joined, but not fetched, that is, do not trigger the value holder. |
| public void | setOrderByExpressions(List<Expression> orderByExpressions)
INTERNAL: Set the order expressions for the query. |
| public void | setPartialAttributeExpressions(List<Expression> partialAttributeExpressions)
INTERNAL: Set the partial attributes to select. |
| public void | setQueryByExamplePolicy(QueryByExamplePolicy queryByExamplePolicy)
PUBLIC: The QueryByExamplePolicy, is a useful to customize the query when Query By Example is used. |
| public void | setReferenceClass(Class<?> aClass)
Overrides org. |
| public void | setReferenceClassName(String aClass)
Overrides org. |
| public void | setSelectionCriteria(Expression expression)
Overrides org. |
| public void | setShouldExtendPessimisticLockScope(boolean isExtended)
INTERNAL: Indicates whether pessimistic lock should also be applied to relation tables (ManyToMany and OneToOne mappings), reference tables (DirectCollection and AggregateCollection mapping). |
| public void | setShouldFilterDuplicates(boolean shouldFilterDuplicates)
PUBLIC: Set if duplicate rows should be filter when using 1-m joining. |
| public void | setShouldIncludeData(boolean shouldIncludeData)
INTERNAL: Set if the rows for the result of the query should also be returned using a complex query result. |
| public void | setShouldOuterJoinSubclasses(boolean shouldOuterJoinSubclasses)
PUBLIC: Set if an outer join should be used to read subclasses. |
| public void | setShouldUseDefaultFetchGroup(boolean shouldUseDefaultFetchGroup)
Set false if the user does not want to use the default fetch group defined in the descriptor level. |
| public void | setShouldUseSerializedObjectPolicy(boolean shouldUseSerializedObjectPolicy)
INTERNAL: Set a flag that indicates whether the query should use SerializedObjectPolicy if descriptor has it. |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public boolean | |
| public boolean | shouldCheckDescriptorForCacheUsage()
PUBLIC: Return whether the descriptor's disableCacheHits setting should be checked prior to querying the cache. |
| public boolean | shouldConformResultsInUnitOfWork()
PUBLIC: Should the results will be checked against the changes within the unit of work and object no longer matching or deleted will be remove, matching new objects will also be added.. |
| public boolean | |
| public boolean | shouldExtendPessimisticLockScope()
INTERNAL: Indicates whether pessimistic lock should also be applied to relation tables (ManyToMany and OneToOne mappings), reference tables (DirectCollection and AggregateCollection mapping). |
| public boolean | |
| public boolean | shouldIncludeData()
INTERNAL: Return if the rows for the result of the query should also be returned using a complex query result. |
| public boolean | |
| public boolean | shouldReadAllMappings()
Overrides org. |
| public boolean | shouldReadMapping(DatabaseMapping mapping, FetchGroup fetchGroup)
Overrides org. |
| public boolean | shouldUseDefaultFetchGroup()
Return false if the query does not use the default fetch group defined in the descriptor level. |
| public boolean | shouldUseSerializedObjectPolicy()
Overrides org. |
| public boolean | supportsResultSetAccessOptimizationOnExecute()
INTERNAL: Indicates whether the query can use ResultSet optimization. |
| public boolean | supportsResultSetAccessOptimizationOnPrepare()
INTERNAL: Indicates whether the query can use ResultSet optimization. |
| public String | toString()
Overrides org. |
| public void | |
| public void | |
| public boolean | usesResultSetAccessOptimization()
Overrides org. |