Class DescriptorQueryManager
- All Implemented Interfaces:
Serializable,Cloneable
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:
- insertQuery - used to insert the object
- updateQuery - used to update the object
- readObjectQuery - used to read a single object by primary key
- readAllQuery - used to read all of the objects of the class
- doesExistQuery - used to determine whether an insert or update should occur
- deleteQuery - used to delete the object
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Expressionprotected org.eclipse.persistence.internal.helper.ConcurrentFixedCachePERF: Expression query call cache for avoiding regenerated dynamic query SQL.protected org.eclipse.persistence.internal.helper.ConcurrentFixedCachePERF: Update call cache for avoiding regenerated update SQL.static final intstatic final TimeUnitprotected DeleteObjectQueryprotected ClassDescriptorprotected DoesExistQueryprotected booleanprotected InsertObjectQueryprotected Expressionstatic final intqueryTimeout 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<String,List<DatabaseQuery>> protected intprotected TimeUnitprotected ReadAllQueryprotected ReadObjectQueryprotected Map<org.eclipse.persistence.internal.helper.DatabaseTable,Expression> protected UpdateObjectQuery -
Constructor Summary
ConstructorsConstructorDescriptionINTERNAL: Initialize the state of the descriptor query manager -
Method Summary
Modifier and TypeMethodDescriptionvoidaddQuery(String name, DatabaseQuery query) PUBLIC: Add the query to the descriptor queries with the given namevoidaddQuery(DatabaseQuery query) PUBLIC: Add the query to the session queriesvoidPUBLIC: Assume that if the objects primary key does not include null then it must exist.voidPUBLIC: Assume that the object does not exist.voidPUBLIC: Default behavior.voidPUBLIC: Perform does exist check on the databaseclone()INTERNAL: Clone the query managerbooleancontainsQuery(String queryName) PUBLIC: Return true if the query is defined on the sessionvoidconvertClassNamesToClasses(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.ADVANCED: Returns the join expression that should be appended to all of the descriptors expressions Contains any multiple table or inheritance dependenciesPUBLIC: Return the pre-defined queries for the descriptor.INTERNAL: Return the cached SQL call for the expression query.getCachedUpdateCalls(Vector updateFields) INTERNAL: Return the cached update SQL call based on the updated fields.ADVANCED: Return the receiver's delete call.ADVANCED: Return the receiver's delete query.ADVANCED: Return the receiver's delete SQL string.INTERNAL: Return the descriptor associated with this descriptor query managerADVANCED: Return the receiver's does-exist call.ADVANCED: Return the receiver's does exist query.ADVANCED: Return the receiver's does exist SQL string.INTERNAL: This method is explicitly used by the Builder only.intADVANCED: Return the max size of the expression query cache for avoiding regenerated dynamic query SQL.ADVANCED: Return the receiver's insert call.ADVANCED: Return the receiver's insert query.ADVANCED: Return the receiver's insert SQL string.getLocalQuery(String name, Vector arguments) INTENAL: Return the query from the set of pre-defined queries with the given name and argument types.getLocalQueryByArgumentTypes(String name, List argumentTypes) INTERNAL: Return the query from the set of pre-defined queries with the given name and argument types.ADVANCED: This is normally generated for descriptors that have multiple tables.INTERNAL: Get the parent DescriptorQueryManager.PUBLIC: Return the pre-defined queries for the descriptor.PUBLIC: Return the query name from the set of pre-defined queries If only one query exists with this name, it will be returned.PUBLIC: Return the query from the set of pre-defined queries with the given name and argument types.protected DatabaseQuerygetQueryFromParent(String name, Vector arguments) INTERNAL: CR#3711: Check if the class for this descriptor has a parent class.intPUBLIC: Return the number of seconds queries will wait for their Statement to execute.ADVANCED: Return the receiver's read-all call.ADVANCED: Return the receiver's read query.ADVANCED: Return the receiver's read SQL string.ADVANCED: Return the receiver's read-object call.ADVANCED: Return the receiver's read query.ADVANCED: Return the receiver's read SQL string.Map<org.eclipse.persistence.internal.helper.DatabaseTable,Expression> INTERNAL: Used in case descriptor has additional tables: each additional table mapped to an expression joining it.ADVANCED: Return the receiver's update call.intADVANCED: Return the size of the update call cache.ADVANCED: Return the receiver's update query.ADVANCED: Return the receiver's update SQL string.booleanADVANCED: Return true if an additional criteria has been set on this query manager.booleanINTERNAL: Return if a custom join expression is used.booleanINTERNAL: Flag that specifies if a delete query is availablebooleanINTERNAL: Flag that specifies if a does exist query is availablebooleanINTERNAL: Flag that specifies if a insert query is availablebooleanINTERNAL: Flag that specifies if a read all query is availablebooleanINTERNAL: Flag that specifies if a read object query is availablebooleanINTERNAL: Flag that specifies if a update query is availablevoidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Post initialize the mappingsvoidinitializeQueryTimeout(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Initialize the queryTimeout to: NoTimeout: If queryTimeout is DefaultTimeout, either directly or via inheritance.voidpostDelete(DeleteObjectQuery query) INTERNAL: Execute the post delete operation for the queryvoidpostInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Post initializations after mappings are initialized.voidpostInsert(WriteObjectQuery query) INTERNAL: Execute the post insert operation for the queryvoidpostUpdate(WriteObjectQuery query) INTERNAL: Execute the post update operation for the queryvoidpreDelete(DeleteObjectQuery query) INTERNAL: Execute the pre delete operation for the queryvoidpreInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Initialize the query manager.voidpreInsert(WriteObjectQuery query) INTERNAL: Execute the pre insert operation for the query.voidpreUpdate(WriteObjectQuery query) INTERNAL: Execute the pre update operation for the queryvoidINTERNAL: Set the cached SQL call for the expression query.voidputCachedUpdateCalls(Vector updateFields, Vector updateCalls) INTERNAL: Cache a clone of the update SQL calls based on the updated fields.voidINTERNAL: Remove the cached expression query.voidremoveQuery(String queryName) PUBLIC: Remove all queries with the given query name from the set of pre-defined queriesvoidremoveQuery(String queryName, Vector argumentTypes) PUBLIC: Remove the specific query with the given queryName and argumentTypes.voidsetAdditionalCriteria(String additionalCriteria) ADVANCED: Set the additional join criteria that will be used to form the additional join expression.voidsetAdditionalJoinExpression(Expression additionalJoinExpression) ADVANCED: Set the additional join expression.voidsetAllQueries(Vector vector) INTERNAL: Set pre-defined queries for the descriptor.voidsetDeleteCall(Call call) ADVANCED: Set the receiver's delete call.voidsetDeleteQuery(DeleteObjectQuery query) ADVANCED: Set the receiver's delete query.voidsetDeleteSQLString(String sqlString) ADVANCED: Set the receiver's delete SQL string.voidsetDescriptor(ClassDescriptor descriptor) INTERNAL: Set the descriptor.voidsetDoesExistCall(Call call) ADVANCED: Set the receiver's does exist call.voidsetDoesExistQuery(DoesExistQuery query) ADVANCED: Set the receiver's does exist query.voidsetDoesExistSQLString(String sqlString) ADVANCED: Set the receiver's does exist SQL string.voidsetExistenceCheck(String token) INTERNAL: This method is explicitly used by the Builder only.voidsetExpressionQueryCacheMaxSize(int maxSize) ADVANCED: Set the max size of the expression query cache for avoiding regenerated dynamic query SQL.protected voidsetHasCustomMultipleTableJoinExpression(boolean hasCustomMultipleTableJoinExpression) INTENAL: Set if a custom join expression is used.voidsetInsertCall(Call call) ADVANCED: Set the receiver's insert call.voidsetInsertQuery(InsertObjectQuery insertQuery) ADVANCED: Set the receiver's insert query.voidsetInsertSQLString(String sqlString) ADVANCED: Set the receiver's insert SQL string.voidsetInternalMultipleTableJoinExpression(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.voidsetMultipleTableJoinExpression(Expression multipleTableJoinExpression) ADVANCED: This is normally generated for descriptors that have multiple tables.voidsetQueries(Map map) PUBLIC: set the pre-defined queries for the descriptor.voidsetQueryTimeout(int queryTimeout) PUBLIC: Set the number of seconds that queries will wait for their Statement to execute.voidsetQueryTimeoutUnit(TimeUnit queryTimeoutUnit) voidsetReadAllCall(Call call) ADVANCED: Set the receiver's read all call.voidsetReadAllQuery(ReadAllQuery query) ADVANCED: Set the receiver's read all query.voidsetReadAllSQLString(String sqlString) ADVANCED: Set the receiver's read SQL string.voidsetReadObjectCall(Call call) ADVANCED: Set the receiver's read object call.voidADVANCED: Set the receiver's read query.voidsetReadObjectSQLString(String sqlString) ADVANCED: Set the receiver's read SQL string.voidsetUpdateCall(Call call) ADVANCED: Set the receiver's update call.voidsetUpdateCallCacheSize(int updateCallCacheSize) ADVANCED: Set the size of the update call cache.voidsetUpdateQuery(UpdateObjectQuery updateQuery) ADVANCED: Set the receiver's update query.voidsetUpdateSQLString(String sqlString) ADVANCED: Set the receiver's update SQL string.protected voidINTERNAL: This method will walk the given expression and mark any parameter expressions as property expressions.
-
Field Details
-
insertQuery
-
updateQuery
-
readObjectQuery
-
readAllQuery
-
deleteQuery
-
doesExistQuery
-
descriptor
-
hasCustomMultipleTableJoinExpression
protected boolean hasCustomMultipleTableJoinExpression -
additionalCriteria
-
additionalJoinExpression
-
multipleTableJoinExpression
-
queries
-
tablesJoinExpressions
protected transient Map<org.eclipse.persistence.internal.helper.DatabaseTable,Expression> tablesJoinExpressions -
cachedUpdateCalls
protected transient org.eclipse.persistence.internal.helper.ConcurrentFixedCache cachedUpdateCallsPERF: Update call cache for avoiding regenerated update SQL. -
cachedExpressionQueries
protected transient org.eclipse.persistence.internal.helper.ConcurrentFixedCache cachedExpressionQueriesPERF: Expression query call cache for avoiding regenerated dynamic query SQL. -
NoTimeout
public static final int NoTimeoutqueryTimeout 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. If there is no parent, default to NoTimeout - NoTimeout, 1..N: overrides parent queryTimeout- See Also:
-
DefaultTimeout
public static final int DefaultTimeout- See Also:
-
queryTimeout
protected int queryTimeout -
DefaultTimeoutUnit
-
queryTimeoutUnit
-
-
Constructor Details
-
DescriptorQueryManager
public DescriptorQueryManager()INTERNAL: Initialize the state of the descriptor query manager
-
-
Method Details
-
setExpressionQueryCacheMaxSize
public void setExpressionQueryCacheMaxSize(int maxSize) ADVANCED: Set the max size of the expression query cache for avoiding regenerated dynamic query SQL. -
getExpressionQueryCacheMaxSize
public int getExpressionQueryCacheMaxSize()ADVANCED: Return the max size of the expression query cache for avoiding regenerated dynamic query SQL. -
addQuery
PUBLIC: Add the query to the descriptor queries with the given name- Parameters:
name- This is the name of the query. It will be set on the query and used to look it up.query- 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.
-
addQuery
PUBLIC: Add the query to the session queries- Parameters:
query- 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.
-
assumeExistenceForDoesExist
public void assumeExistenceForDoesExist()PUBLIC: Assume that if the objects primary key does not include null then it must exist. This may be used if the application guarantees or does not care about the existence check. -
assumeNonExistenceForDoesExist
public void assumeNonExistenceForDoesExist()PUBLIC: Assume that the object does not exist. This may be used if the application guarantees or does not care about the existence check. This will always force an insert to be called. -
checkCacheForDoesExist
public void checkCacheForDoesExist()PUBLIC: Default behavior. Assume that if the objects primary key does not include null and it is in the cache, then is must exist. -
checkDatabaseForDoesExist
public void checkDatabaseForDoesExist()PUBLIC: Perform does exist check on the database -
clone
INTERNAL: Clone the query manager -
containsQuery
PUBLIC: Return true if the query is defined on the session -
convertClassNamesToClasses
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.- Parameters:
classLoader-
-
getAdditionalJoinExpression
ADVANCED: Returns the join expression that should be appended to all of the descriptors expressions Contains any multiple table or inheritance dependencies -
getDeleteQuery
ADVANCED: Return the receiver's delete query. This should be an instance of a valid subclass of DeleteObjectQuery. If specified this is used by the descriptor to delete itself and its private parts from the database. This gives the user the ability to define exactly how to delete the data from the database, or access data external from the database or from some other framework. -
getDeleteSQLString
ADVANCED: Return the receiver's delete SQL string. This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields.Example, "delete from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID".
-
getDescriptor
INTERNAL: Return the descriptor associated with this descriptor query manager -
getDoesExistQuery
ADVANCED: Return the receiver's does exist query. This should be an instance of a valid subclass of DoesExistQuery. If specified this is used by the descriptor to query existence of an object in the database. This gives the user the ability to define exactly how to query existence from the database, or access data external from the database or from some other framework. -
getDoesExistSQLString
ADVANCED: Return the receiver's does exist SQL string. This allows the user to override the SQL generated by EclipseLink, with there own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. This must return null if the object does not exist, otherwise return a database row.Example, "select EMPLOYEE_ID from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID".
-
getExistenceCheck
INTERNAL: This method is explicitly used by the Builder only. -
getInsertQuery
ADVANCED: Return the receiver's insert query. This should be an instance of a valid subclass of InsertObjectQuery. If specified this is used by the descriptor to insert itself into the database. If the receiver uses sequence numbers, this query must return the updated sequence value. This gives the user the ability to define exactly how to insert the data into the database, or access data external from the database or from some other framework. -
getInsertSQLString
ADVANCED: Return the receiver's insert SQL string. This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields.Example, "insert into EMPLOYEE (F_NAME, L_NAME) values (#F_NAME, #L_NAME)".
-
getMultipleTableJoinExpression
ADVANCED: This is normally generated for descriptors that have multiple tables. However, if the additional table does not reference the primary tables primary key, this expression may be set directly. -
getQueries
PUBLIC: Return the pre-defined queries for the descriptor. The Map returned contains Lists of queries.- See Also:
-
getAllQueries
PUBLIC: Return the pre-defined queries for the descriptor. The Vector returned contains all queries for this descriptor.- See Also:
-
setAllQueries
INTERNAL: Set pre-defined queries for the descriptor. Converts the Vector to a hashtable -
setQueries
PUBLIC: set the pre-defined queries for the descriptor. Used to write out deployment XML -
getQuery
PUBLIC: Return the query name from the set of pre-defined queries If only one query exists with this name, it will be returned. If there are multiple queries of this name, this method will search for a query with no arguments and return the first one it finds.- See Also:
-
getQuery
PUBLIC: Return the query from the set of pre-defined queries with the given name and argument types. This allows for common queries to be pre-defined, reused and executed by name. This method should be used if the Session has multiple queries with the same name but different arguments. If only one query exists, it will be returned regardless of the arguments. If multiple queries exist, the first query that has corresponding argument types will be returned- See Also:
-
getLocalQuery
INTENAL: Return the query from the set of pre-defined queries with the given name and argument types. This allows for common queries to be pre-defined, reused and executed by name. Only returns those queries locally defined, not superclass's queries If only one query exists, it will be returned regardless of the arguments. If multiple queries exist, the first query that has corresponding argument types will be returned- See Also:
-
getLocalQueryByArgumentTypes
INTERNAL: Return the query from the set of pre-defined queries with the given name and argument types. This allows for common queries to be pre-defined, reused and executed by name. Only returns those queries locally defined, not superclass's queries If only one query exists, it will be returned regardless of the arguments. If multiple queries exist, the first query that has corresponding argument types will be returned- See Also:
-
getQueryFromParent
INTERNAL: CR#3711: Check if the class for this descriptor has a parent class. Then search this parent's descriptor for a query with the same name and arguments. If nothing found, return null. This method should only be used recursively by getQuery(). -
getReadAllQuery
ADVANCED: Return the receiver's read query. This should be an instance of a valid subclass of ReadAllQuery. -
getReadAllSQLString
ADVANCED: Return the receiver's read SQL string. This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. The arguments are translated from the fields of the read arguments row, through replacing the field names marked by '#' with the values for those fields. Note that this is only used on readAllObjects(Class), and not when an expression is provided.Example, "select * from EMPLOYEE"
-
getReadObjectQuery
ADVANCED: Return the receiver's read query. This should be an instance of a valid subclass of ReadObjectQuery. If specified this is used by the descriptor to read itself from the database. The read arguments must be the primary key of the object only. This gives the user the ability to define exactly how to read the object from the database, or access data external from the database or from some other framework. -
getReadObjectSQLString
ADVANCED: Return the receiver's read SQL string. This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. The arguments are translated from the fields of the read arguments row, through replacing the field names marked by '#' with the values for those fields. This must accept only the primary key of the object as arguments.Example, "select * from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID"
-
getUpdateQuery
ADVANCED: Return the receiver's update query. This should be an instance of a valid subclass of UpdateObjectQuery. If specified this is used by the descriptor to insert itself into the database. If the receiver uses optimistic locking this must raise an error on optimistic lock failure. This gives the user the ability to define exactly how to update the data into the database, or access data external from the database or from some other framework. -
getUpdateSQLString
ADVANCED: Return the receiver's update SQL string. This allows the user to override the SQL generated by EclipseLink, with there own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. This must check the optimistic lock field and raise an error on optimistic lock failure.Example, "update EMPLOYEE set F_NAME to #F_NAME, L_NAME to #L_NAME where EMPLOYEE_ID = #EMPLOYEE_ID".
-
hasAdditionalCriteria
public boolean hasAdditionalCriteria()ADVANCED: Return true if an additional criteria has been set on this query manager. -
hasCustomMultipleTableJoinExpression
public boolean hasCustomMultipleTableJoinExpression()INTERNAL: Return if a custom join expression is used. -
hasDeleteQuery
public boolean hasDeleteQuery()INTERNAL: Flag that specifies if a delete query is available -
hasDoesExistQuery
public boolean hasDoesExistQuery()INTERNAL: Flag that specifies if a does exist query is available -
hasInsertQuery
public boolean hasInsertQuery()INTERNAL: Flag that specifies if a insert query is available -
hasReadAllQuery
public boolean hasReadAllQuery()INTERNAL: Flag that specifies if a read all query is available -
hasReadObjectQuery
public boolean hasReadObjectQuery()INTERNAL: Flag that specifies if a read object query is available -
hasUpdateQuery
public boolean hasUpdateQuery()INTERNAL: Flag that specifies if a update query is available -
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Post initialize the mappings -
initializeQueryTimeout
public void initializeQueryTimeout(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Initialize the queryTimeout to: NoTimeout: If queryTimeout is DefaultTimeout, either directly or via inheritance. Parent's Timeout: If queryTimeout is something other than DefaultTimeout via my parent. -
getParentDescriptorQueryManager
INTERNAL: Get the parent DescriptorQueryManager. Caution must be used in using this method as it expects the descriptor to have inheritance. Calling this when the descriptor that does not use inheritance will cause problems, #hasInheritance() must always first be called. -
postDelete
INTERNAL: Execute the post delete operation for the query -
postInitialize
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException INTERNAL: Post initializations after mappings are initialized.- Throws:
DescriptorException
-
updatePropertyParameterExpression
INTERNAL: This method will walk the given expression and mark any parameter expressions as property expressions. This is done when additional criteria has been specified and parameter values must be resolved through session properties. -
postInsert
INTERNAL: Execute the post insert operation for the query -
postUpdate
INTERNAL: Execute the post update operation for the query -
preDelete
INTERNAL: Execute the pre delete operation for the query -
preInitialize
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Initialize the query manager. Any custom queries must be inherited from the parent before any initialization. -
preInsert
INTERNAL: Execute the pre insert operation for the query. -
preUpdate
INTERNAL: Execute the pre update operation for the query -
removeQuery
PUBLIC: Remove all queries with the given query name from the set of pre-defined queries- See Also:
-
removeQuery
PUBLIC: Remove the specific query with the given queryName and argumentTypes.- See Also:
-
setAdditionalCriteria
ADVANCED: Set the additional join criteria that will be used to form the additional join expression. The additionalCriteria is a jpql fragment at this point. -
setAdditionalJoinExpression
ADVANCED: Set the additional join expression. Used in conjunction with multiple tables and inheritance relationships. This can also be used if a sub-expression is always required to be appended to all queries. Such as tables that are shared based on a type field without inheritance. -
setDeleteQuery
ADVANCED: Set the receiver's delete query. This should be an instance of a valid subclass of DeleteObjectQuery. If specified this is used by the descriptor to delete itself and its private parts from the database. This gives the user the ability to define exactly how to delete the data from the database, or access data external from the database or from some other framework. -
setDeleteSQLString
ADVANCED: Set the receiver's delete SQL string. This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.Example, "delete from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID".
-
setDeleteCall
ADVANCED: Set the receiver's delete call. This allows the user to override the delete operation. -
setDescriptor
INTERNAL: Set the descriptor. -
setDoesExistQuery
ADVANCED: Set the receiver's does exist query. This should be an instance of a valid subclass of DoesExistQuery. If specified this is used by the descriptor to query existence of an object in the database. This gives the user the ability to define exactly how to query existence from the database, or access data external from the database or from some other framework. -
setDoesExistSQLString
ADVANCED: Set the receiver's does exist SQL string. This allows the user to override the SQL generated by EclipseLink, with there own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. This must return null if the object does not exist, otherwise return a database row. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.Example, "select EMPLOYEE_ID from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID".
-
setDoesExistCall
ADVANCED: Set the receiver's does exist call. This allows the user to override the does exist operation. -
setExistenceCheck
INTERNAL: This method is explicitly used by the Builder only.- Throws:
DescriptorException
-
setHasCustomMultipleTableJoinExpression
protected void setHasCustomMultipleTableJoinExpression(boolean hasCustomMultipleTableJoinExpression) INTENAL: Set if a custom join expression is used. -
setInsertQuery
ADVANCED: Set the receiver's insert query. This should be an instance of a valid subclass of InsertObjectQuery. If specified this is used by the descriptor to insert itself into the database. This gives the user the ability to define exactly how to insert the data into the database, or access data external from the database or from some other framework. -
setInsertCall
ADVANCED: Set the receiver's insert call. This allows the user to override the insert operation. -
setInsertSQLString
ADVANCED: Set the receiver's insert SQL string. This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.Example, "insert into EMPLOYEE (F_NAME, L_NAME) values (#F_NAME, #L_NAME)".
-
getInsertCall
ADVANCED: Return the receiver's insert call. This allows the user to override the insert operation. -
getUpdateCall
ADVANCED: Return the receiver's update call. This allows the user to override the update operation. -
getDeleteCall
ADVANCED: Return the receiver's delete call. This allows the user to override the delete operation. -
getReadObjectCall
ADVANCED: Return the receiver's read-object call. This allows the user to override the read-object operation. -
getReadAllCall
ADVANCED: Return the receiver's read-all call. This allows the user to override the read-all operation. -
getDoesExistCall
ADVANCED: Return the receiver's does-exist call. This allows the user to override the does-exist operation. -
getTablesJoinExpressions
public Map<org.eclipse.persistence.internal.helper.DatabaseTable,Expression> getTablesJoinExpressions()INTERNAL: Used in case descriptor has additional tables: each additional table mapped to an expression joining it. -
setInternalMultipleTableJoinExpression
INTERNAL: Used to set the multiple table join expression that was generated by EclipseLink as opposed to a custom one supplied by the user. -
setMultipleTableJoinExpression
ADVANCED: This is normally generated for descriptors that have multiple tables. However, if the additional table does not reference the primary table's primary key, this expression may be set directly. -
setReadAllQuery
ADVANCED: Set the receiver's read all query. This should be an instance of a valid subclass of ReadAllQuery. If specified this is used by the descriptor to read all instances of its class from the database. This gives the user the ability to define exactly how to read all objects from the database, or access data external from the database or from some other framework. Note that this is only used on readAllObjects(Class), and not when an expression is provided. -
setReadAllSQLString
ADVANCED: Set the receiver's read SQL string. This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. The arguments are translated from the fields of the read arguments row, through replacing the field names marked by '#' with the values for those fields. Note that this is only used on readAllObjects(Class), and not when an expression is provided. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.Example, "select * from EMPLOYEE"
-
setReadAllCall
ADVANCED: Set the receiver's read all call. This allows the user to override the read all operation. Note that this is only used on readAllObjects(Class), and not when an expression is provided. -
setReadObjectQuery
ADVANCED: Set the receiver's read query. This should be an instance of a valid subclass of ReadObjectQuery If specified this is used by the descriptor to read itself from the database. The read arguments must be the primary key of the object only. This gives the user the ability to define exactly how to read the object from the database, or access data external from the database or from some other framework. -
setReadObjectSQLString
ADVANCED: Set the receiver's read SQL string. This allows the user to override the SQL generated by EclipseLink, with their own SQL or procedure call. The arguments are translated from the fields of the read arguments row, through replacing the field names marked by '#' with the values for those fields. This must accept only the primary key of the object as arguments. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.Example, "select * from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID"
-
setReadObjectCall
ADVANCED: Set the receiver's read object call. This allows the user to override the read object operation. This must accept only the primary key of the object as arguments. -
setUpdateQuery
ADVANCED: Set the receiver's update query. This should be an instance of a valid subclass of UpdateObjectQuery. If specified this is used by the descriptor to update itself in the database. If the receiver uses optimistic locking this must raise an error on optimistic lock failure. This gives the user the ability to define exactly how to update the data into the database, or access data external from the database or from some other framework. -
setUpdateSQLString
ADVANCED: Set the receiver's update SQL string. This allows the user to override the SQL generated by EclipseLink, with there own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. This must check the optimistic lock field and raise an error on optimistic lock failure. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.Example, "update EMPLOYEE set F_NAME to #F_NAME, L_NAME to #L_NAME where EMPLOYEE_ID = #EMPLOYEE_ID".
-
setUpdateCall
ADVANCED: Set the receiver's update call. This allows the user to override the update operation. -
getQueryTimeout
public int getQueryTimeout()PUBLIC: Return the number of seconds queries will wait for their Statement to execute. - DefaultTimeout: get queryTimeout from parent DescriptorQueryManager. If there is no parent, default to NoTimeout - NoTimeout, 1..N: overrides parent queryTimeout -
getQueryTimeoutUnit
-
setQueryTimeout
public void setQueryTimeout(int queryTimeout) PUBLIC: Set the number of seconds that queries will wait for their Statement to execute. If the limit is exceeded, a DatabaseException is thrown. - DefaultTimeout: get queryTimeout from parent DescriptorQueryManager. If there is no parent, default to NoTimeout - NoTimeout, 1..N: overrides parent queryTimeout -
setQueryTimeoutUnit
-
getUpdateCallCacheSize
public int getUpdateCallCacheSize()ADVANCED: Return the size of the update call cache. The update call cache is used to cache the update SQL to avoid regeneration. Since every update with different fields produces different SQL, this cache allows caching of the update SQL based on the fields being updated. The default cache size is 10, the update call cache can be disabled through setting the size to 0. -
setUpdateCallCacheSize
public void setUpdateCallCacheSize(int updateCallCacheSize) ADVANCED: Set the size of the update call cache. The update call cache is used to cache the update SQL to avoid regeneration. Since every update with different fields produces different SQL, this cache allows caching of the update SQL based on the fields being updated. The default cache size is 10, the update call cache can be disabled through setting the size to 0. -
getCachedUpdateCalls
INTERNAL: Return the cached update SQL call based on the updated fields. PERF: Allow caching of the update SQL call to avoid regeneration. -
putCachedUpdateCalls
INTERNAL: Cache a clone of the update SQL calls based on the updated fields. If the max size is reached, do not cache the call. The call's query must be dereferenced in order to allow the GC of a related session. PERF: Allow caching of the update SQL call to avoid regeneration. -
getCachedExpressionQuery
INTERNAL: Return the cached SQL call for the expression query. PERF: Allow caching of expression query SQL call to avoid regeneration. -
putCachedExpressionQuery
INTERNAL: Set the cached SQL call for the expression query. PERF: Allow caching of expression query SQL call to avoid regeneration. -
removeCachedExpressionQuery
INTERNAL: Remove the cached expression query. PERF: Allow caching of expression query SQL call to avoid regeneration.
-