Purpose: The query manager allows for the database operations that EclipseLink performs to be customized by the application. For each descriptor a query can be given that controls how a operation will occur. A common example is if the application requires a stored procedure to be used to insert the object, it can override the SQL call in the insert query that EclipseLink will use to insert the object. Queries can be customized to extend EclipseLink behavior, access non-relational data or use stored procedures or customized SQL calls.
The queries that can be customized include:
ClassDescriptor
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected transient Expression | |
| protected transient ConcurrentFixedCache | cachedExpressionQueries
PERF: Expression query call cache for avoiding regenerated dynamic query SQL. |
| protected transient ConcurrentFixedCache | cachedUpdateCalls
PERF: Update call cache for avoiding regenerated update SQL. |
| public static final int | |
| public static final TimeUnit | |
| protected DeleteObjectQuery | |
| protected ClassDescriptor | |
| protected DoesExistQuery | |
| protected boolean | |
| protected InsertObjectQuery | |
| protected transient Expression | |
| public static final int | NoTimeout
queryTimeout has three possible settings: DefaultTimeout, NoTimeout, and 1..N This applies to both DatabaseQuery.queryTimeout and DescriptorQueryManager.queryTimeout DatabaseQuery.queryTimeout: - DefaultTimeout: get queryTimeout from DescriptorQueryManager - NoTimeout, 1..N: overrides queryTimeout in DescriptorQueryManager DescriptorQueryManager.queryTimeout: - DefaultTimeout: get queryTimeout from parent DescriptorQueryManager. |
| protected Map | |
| protected int | |
| protected TimeUnit | |
| protected ReadAllQuery | |
| protected ReadObjectQuery | |
| protected transient Map | |
| protected UpdateObjectQuery |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addQuery(String
This is the name of the query. It will be set on the query and used to look it up. name, DatabaseQuery This is the query that will be added. If the query being added has parameters, the
existing list of queries will be checked for matching queries. If a matching query exists,
it will be replaced. query)PUBLIC: Add the query to the descriptor queries with the given name |
| public synchronized void | addQuery(DatabaseQuery
DatabaseQuery This is the query that will be added. If the query being added has parameters, the
existing list of queries will be checked for matching queries. If a matching query exists,
it will be replaced. query)PUBLIC: Add the query to the session queries |
| public void | assumeExistenceForDoesExist()
PUBLIC: Assume that if the objects primary key does not include null then it must exist. |
| public void | |
| public void | |
| public void | |
| public Object | |
| public boolean | |
| public void | convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this Query Manager to actual class-based settings This method is implemented by subclasses as necessary. |
| public Expression | getAdditionalJoinExpression()
ADVANCED: Returns the join expression that should be appended to all of the descriptors expressions Contains any multiple table or inheritance dependencies |
| public Vector | |
| private ConcurrentFixedCache | |
| public DatabaseQuery | getCachedExpressionQuery(DatabaseQuery query)
INTERNAL: Return the cached SQL call for the expression query. |
| private ConcurrentFixedCache | |
| public Vector | getCachedUpdateCalls(Vector<E> updateFields)
INTERNAL: Return the cached update SQL call based on the updated fields. |
| public Call | |
| public DeleteObjectQuery | |
| public String | |
| public ClassDescriptor | |
| public Call | |
| public DoesExistQuery | |
| public String | |
| public String | |
| public int | getExpressionQueryCacheMaxSize()
ADVANCED: Return the max size of the expression query cache for avoiding regenerated dynamic query SQL. |
| public Call | |
| public InsertObjectQuery | |
| public String | |
| public DatabaseQuery | getLocalQuery(String name, Vector<E> arguments)
INTENAL: Return the query from the set of pre-defined queries with the given name and argument types. |
| public DatabaseQuery | getLocalQueryByArgumentTypes(String name, List<E> argumentTypes)
INTERNAL: Return the query from the set of pre-defined queries with the given name and argument types. |
| public Expression | getMultipleTableJoinExpression()
ADVANCED: This is normally generated for descriptors that have multiple tables. |
| public DescriptorQueryManager | |
| public Map | |
| public DatabaseQuery | |
| public DatabaseQuery | |
| protected DatabaseQuery | getQueryFromParent(String name, Vector<E> arguments)
INTERNAL: CR#3711: Check if the class for this descriptor has a parent class. |
| public int | getQueryTimeout()
PUBLIC: Return the number of seconds queries will wait for their Statement to execute. |
| public TimeUnit | |
| public Call | |
| public ReadAllQuery | |
| public String | |
| public Call | |
| public ReadObjectQuery | |
| public String | |
| public Map | getTablesJoinExpressions()
INTERNAL: Used in case descriptor has additional tables: each additional table mapped to an expression joining it. |
| public Call | |
| public int | |
| public UpdateObjectQuery | |
| public String | |
| public boolean | hasAdditionalCriteria()
ADVANCED: Return true if an additional criteria has been set on this query manager. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public void | initializeQueryTimeout(AbstractSession session)
INTERNAL: Initialize the queryTimeout to: NoTimeout: If queryTimeout is DefaultTimeout, either directly or via inheritance. |
| private void | |
| public void | |
| public void | postInitialize(AbstractSession session)
INTERNAL: Post initializations after mappings are initialized. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | putCachedExpressionQuery(DatabaseQuery query)
INTERNAL: Set the cached SQL call for the expression query. |
| public void | putCachedUpdateCalls(Vector<E> updateFields, Vector<E> updateCalls)
INTERNAL: Cache a clone of the update SQL calls based on the updated fields. |
| public void | |
| public void | removeQuery(String queryName)
PUBLIC: Remove all queries with the given query name from the set of pre-defined queries |
| public void | removeQuery(String queryName, Vector<E> argumentTypes)
PUBLIC: Remove the specific query with the given queryName and argumentTypes. |
| public void | setAdditionalCriteria(String additionalCriteria)
ADVANCED: Set the additional join criteria that will be used to form the additional join expression. |
| public void | setAdditionalJoinExpression(Expression additionalJoinExpression)
ADVANCED: Set the additional join expression. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setExpressionQueryCacheMaxSize(int maxSize)
ADVANCED: Set the max size of the expression query cache for avoiding regenerated dynamic query SQL. |
| protected void | setHasCustomMultipleTableJoinExpression(boolean hasCustomMultipleTableJoinExpression)
INTENAL: Set if a custom join expression is used. |
| public void | |
| public void | |
| public void | |
| public void | setInternalMultipleTableJoinExpression(Expression multipleTableJoinExpression)
INTERNAL: Used to set the multiple table join expression that was generated by EclipseLink as opposed to a custom one supplied by the user. |
| public void | setMultipleTableJoinExpression(Expression multipleTableJoinExpression)
ADVANCED: This is normally generated for descriptors that have multiple tables. |
| public void | |
| public void | setQueryTimeout(int queryTimeout)
PUBLIC: Set the number of seconds that queries will wait for their Statement to execute. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| protected void | updatePropertyParameterExpression(Expression exp)
INTERNAL: This method will walk the given expression and mark any parameter expressions as property expressions. |