Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

B32476-02


oracle.toplink.queryframework
Class DatabaseQuery

java.lang.Object
  extended by oracle.toplink.queryframework.DatabaseQuery

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, oracle.toplink.internal.helper.FalseUndefinedTrue
Direct Known Subclasses:
DoesExistQuery, ModifyQuery, ReadQuery

public abstract class DatabaseQuery
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, oracle.toplink.internal.helper.FalseUndefinedTrue

Purpose: Abstract class for all database query objects. DatabaseQuery is a visible class to the TopLink user. Users create an appropriate query by creating an instance of a concrete subclasses of DatabaseQuery.

Responsibilities:

Since:
TOPLink/Java 1.0
See Also:
Serialized Form

Field Summary
static int CascadeAggregateDelete
           
static int CascadeAllParts
           
static int CascadeByMapping
           
static int CascadeDependentParts
           
static int CascadePrivateParts
           
static int NoCascading
           

 

Constructor Summary
DatabaseQuery()
          Initialize the state of the query

 

Method Summary
 void addArgument(java.lang.String argumentName)
          Add the argument named argumentName.
 void addArgument(java.lang.String argumentName, java.lang.Class type)
          Add the argument named argumentName and its class type.
 void addArgument(java.lang.String argumentName, java.lang.String typeAsString)
          Add the argument named argumentName and its class type.
 void addArgumentValue(java.lang.Object argumentValue)
          Add the argumentValue.
 void addArgumentValues(java.util.Vector theArgumentValues)
          Add the argumentValues to the query.
 void addCall(Call call)
          Used to define a store procedure or SQL query.
 void addStatement(oracle.toplink.internal.expressions.SQLStatement statement)
          Used to define a statement level query.
 void bindAllParameters()
          Bind all arguments to any SQL statement.
 void cacheStatement()
          Cache the prepared statements, this requires full parameter binding as well.
 void cascadeAllParts()
          Cascade the query and its properties on the queries object(s) and all objects related to the queries object(s).
 void cascadeByMapping()
          Cascade the query and its properties on the queries object(s) and all related objects where the mapping has been set to cascade the merge.
 void cascadePrivateParts()
          Cascade the query and its properties on the queries object(s) and all privately owned objects related to the queries object(s).
 void dontBindAllParameters()
          Do not Bind all arguments to any SQL statement.
 void dontCacheStatement()
          Dont cache the prepared statements, this requires full parameter binding as well.
 void dontCascadeParts()
          Do not cascade the query and its properties on the queries object(s) relationships.
 void dontMaintainCache()
          Set for the identity map (cache) to be ignored completely.
 DatabaseCall getCall()
          OBSOLETE: Return the call for this query.
 java.util.List getCalls()
          Deprecated.  
 Call getDatasourceCall()
          ADVANCED: Return the call for this query.
 java.util.List getDatasourceCalls()
          ADVANCED: Return the calls for this query.
 java.lang.String getEJBQLString()
          Return the EJBQL string of the query.
 java.lang.Boolean getFlushOnExecute()
          If executed against a RepeatableWriteUnitOfWork if this attribute is true TopLink will write changes to the database before executing the query.
 java.lang.String getHintString()
          Return the current database hint string of the query.
 java.lang.String getJPQLString()
          Return the JPQL string of the query.
 java.lang.String getName()
          Return the name of the query
 int getQueryTimeout()
          Return the number of seconds the driver will wait for a Statement to execute to the given number of seconds.
 QueryRedirector getRedirector()
          Return the query redirector.
 java.lang.Class getReferenceClass()
          Return the domain class associated with this query.
 Expression getSelectionCriteria()
          Return the selection criteria of the query.
 java.lang.String getSessionName()
          Return the name of the session that the query should be executed under.
 oracle.toplink.internal.expressions.SQLStatement getSQLStatement()
          Return the SQL statement of the query.
 java.lang.String getSQLString()
          ADVANCED: Return the SQL string of the query.
 java.util.List getSQLStrings()
          ADVANCED: Return the SQL strings of the query.
 java.lang.String getTranslatedSQLString(Session session, Record translationRow)
          ADVANCED: This can be used to access a queries translated SQL if they have been prepared, (i.e. query.prepareCall()).
 java.util.List getTranslatedSQLStrings(Session session, Record translationRow)
          ADVANCED: This can be used to access a queries translated SQL if they have been prepared, (i.e. query.prepareCall()).
 boolean hasSessionName()
          Return if a name of the session that the query should be executed under has been specified.
 void ignoreBindAllParameters()
          Session's shouldBindAllParameters() defines whether to bind or not (default setting)
 void ignoreCacheStatement()
          Session's shouldCacheAllStatements() defines whether to cache or not (default setting)
 boolean isCallQuery()
          Return true if this query uses an SQL or stored procedure, or SDK call.
 boolean isDataModifyQuery()
          Return if this is a data modify query.
 boolean isDataReadQuery()
          Return if this is a data read query.
 boolean isDeleteAllQuery()
          Return if this is a delete all query.
 boolean isDeleteObjectQuery()
          Return if this is a delete object query.
 boolean isDirectReadQuery()
          Return if this is a direct read query.
 boolean isExpressionQuery()
          Return true if this query uses an expression query mechanism
 boolean isInsertObjectQuery()
          Return true if this is an insert object query.
 boolean isModifyAllQuery()
          Return true if this is a modify all query.
 boolean isModifyQuery()
          Return true if this is a modify query.
 boolean isNativeConnectionRequired()
          ADVANCED: Return if the descriptor requires usage of a native (unwrapped) JDBC connection.
 boolean isObjectBuildingQuery()
          Return if this is an object building query.
 boolean isObjectLevelModifyQuery()
          Return true if this is an object level modify query.
 boolean isObjectLevelReadQuery()
          Return true if this is an object level read query.
 boolean isReadAllQuery()
          Return true if this is a read all query.
 boolean isReadObjectQuery()
          Return ture if this is a read object query.
 boolean isReadQuery()
          Return true if this is a read query.
 boolean isReportQuery()
          Return true if this is a report query.
 boolean isSQLCallQuery()
          Return true if this query uses an SQL query mechanism .
 boolean isUpdateAllQuery()
          Return true if this is an update all query.
 boolean isUpdateObjectQuery()
          Return true if this is an update object query.
 boolean isValueReadQuery()
          Return if this is a value read query.
 boolean isWriteObjectQuery()
          Return true if this is a write object query.
 void maintainCache()
          Set for the identity map (cache) to be maintained.
 void prepareCall(Session session, Record translationRow)
          ADVANCED: Pre-generate the call/SQL for the query.
 void setCall(Call call)
          Used to define a store procedure or SQL query.
 void setDatasourceCall(Call call)
          Used to define a store procedure or SQL query.
 void setEJBQLString(java.lang.String ejbqlString)
          Set the EJBQL string of the query.
 void setFlushOnExecute(java.lang.Boolean flushMode)
          If executed against a RepeatableWriteUnitOfWork if this attribute is true TopLink will write changes to the database before executing the query.
 void setHintString(java.lang.String newHintString)
          Used to set the database hint string on the query.
 void setIsNativeConnectionRequired(boolean isNativeConnectionRequired)
          ADVANCED: Set if the descriptor requires usage of a native (unwrapped) JDBC connection.
 void setJPQLString(java.lang.String jpqlString)
          Set the JPQL string of the query.
 void setName(java.lang.String queryName)
          Set the query's name.
 void setQueryTimeout(int queryTimeout)
          Set the number of seconds the driver will wait for a Statement to execute to the given number of seconds.
 void setRedirector(QueryRedirector redirector)
          Set the query redirector.
 void setSelectionCriteria(Expression expression)
          To any user of this object.
 void setSessionName(java.lang.String sessionName)
          Set the name of the session that the query should be executed under.
 void setShouldBindAllParameters(boolean shouldBindAllParameters)
          Bind all arguments to any SQL statement.
 void setShouldCacheStatement(boolean shouldCacheStatement)
          Cache the prepared statements, this requires full parameter binding as well.
 void setShouldMaintainCache(boolean shouldMaintainCache)
          Set if the identity map (cache) should be used or not.
 void setShouldPrepare(boolean shouldPrepare)
          Set if the query should be prepared.
 void setShouldUseWrapperPolicy(boolean shouldUseWrapperPolicy)
          ADVANCED: The wrapper policy can be enable on a query.
 void setSQLStatement(oracle.toplink.internal.expressions.SQLStatement sqlStatement)
          To any user of this object.
 void setSQLString(java.lang.String sqlString)
          To any user of this object.
 boolean shouldBindAllParameters()
          Bind all arguments to any SQL statement.
 boolean shouldCacheStatement()
          Cache the prepared statements, this requires full parameter binding as well.
 boolean shouldCascadeAllParts()
          Flag used to determine if all parts should be cascaded
 boolean shouldCascadeByMapping()
          Mappings should be checked to determined if the current operation should be cascaded to the objects referenced.
 boolean shouldCascadeParts()
          Flag used to determine if any parts should be cascaded
 boolean shouldCascadePrivateParts()
          Flag used to determine if any private parts should be cascaded
 boolean shouldIgnoreBindAllParameters()
          Local shouldBindAllParameters() should be ignored, Session's shouldBindAllParameters() should be used.
 boolean shouldIgnoreCacheStatement()
          Local shouldCacheStatement() should be ignored, Session's shouldCacheAllStatements() should be used.
 boolean shouldMaintainCache()
          Return if the identity map (cache) should be used or not.
 boolean shouldPrepare()
          Return if the query should be prepared.
 boolean shouldUseWrapperPolicy()
          ADVANCED: The wrapper policy can be enabled on a query.
 java.lang.String toString()
           

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

NoCascading

public static final int NoCascading
See Also:
Constant Field Values

CascadePrivateParts

public static final int CascadePrivateParts
See Also:
Constant Field Values

CascadeAllParts

public static final int CascadeAllParts
See Also:
Constant Field Values

CascadeDependentParts

public static final int CascadeDependentParts
See Also:
Constant Field Values

CascadeAggregateDelete

public static final int CascadeAggregateDelete
See Also:
Constant Field Values

CascadeByMapping

public static final int CascadeByMapping
See Also:
Constant Field Values

Constructor Detail

DatabaseQuery

public DatabaseQuery()
Initialize the state of the query

Method Detail

addArgument

public void addArgument(java.lang.String argumentName)
Add the argument named argumentName. This will cause the translation of references of argumentName in the receiver's expression, with the value of the argument as supplied to the query in order from executeQuery()

addArgument

public void addArgument(java.lang.String argumentName,
                        java.lang.Class type)
Add the argument named argumentName and its class type. This will cause the translation of references of argumentName in the receiver's expression, with the value of the argument as supplied to the query in order from executeQuery(). Specifying the class type is important if identically named queries are used but with different argument lists.

addArgument

public void addArgument(java.lang.String argumentName,
                        java.lang.String typeAsString)
Add the argument named argumentName and its class type. This will cause the translation of references of argumentName in the receiver's expression, with the value of the argument as supplied to the query in order from executeQuery(). Specifying the class type is important if identically named queries are used but with different argument lists.

addArgumentValue

public void addArgumentValue(java.lang.Object argumentValue)
Add the argumentValue. Argument values must be added in the same order the arguments are defined.

addArgumentValues

public void addArgumentValues(java.util.Vector theArgumentValues)
Add the argumentValues to the query. Argument values must be added in the same order the arguments are defined.

addCall

public void addCall(Call call)
Used to define a store procedure or SQL query. This may be used for multiple SQL executions to be mapped to a single query. This cannot be used for cursored selects, delete alls or does exists.

addStatement

public void addStatement(oracle.toplink.internal.expressions.SQLStatement statement)
Used to define a statement level query. This may be used for multiple SQL executions to be mapped to a single query. This cannot be used for cursored selects, delete alls or does exists.

bindAllParameters

public void bindAllParameters()
Bind all arguments to any SQL statement.

cacheStatement

public void cacheStatement()
Cache the prepared statements, this requires full parameter binding as well.

cascadeAllParts

public void cascadeAllParts()
Cascade the query and its properties on the queries object(s) and all objects related to the queries object(s). This includes private and independent relationships, but not read-only relationships. This will still stop on uninstantiated indirection objects except for deletion. Great caution should be used in using the property as the query may effect a large number of objects. This policy is used by the unit of work to ensure persistence by reachability.

cascadeByMapping

public void cascadeByMapping()
Cascade the query and its properties on the queries object(s) and all related objects where the mapping has been set to cascade the merge.

cascadePrivateParts

public void cascadePrivateParts()
Cascade the query and its properties on the queries object(s) and all privately owned objects related to the queries object(s). This is the default for write and delete queries. This policy should normally be used for refreshing, otherwise you could refresh half of any object.

dontBindAllParameters

public void dontBindAllParameters()
Do not Bind all arguments to any SQL statement.

dontCacheStatement

public void dontCacheStatement()
Dont cache the prepared statements, this requires full parameter binding as well.

dontCascadeParts

public void dontCascadeParts()
Do not cascade the query and its properties on the queries object(s) relationships. This does not effect the queries private parts but only the object(s) direct row-level attributes. This is the default for read queries and can be used in writting if it is known that only row-level attributes changed, or to resolve circular foreign key dependencies.

dontMaintainCache

public void dontMaintainCache()
Set for the identity map (cache) to be ignored completely. The cache check will be skipped and the result will not be put into the identity map. This can be used to retreive the exact state of an object on the database. By default the identity map is always maintained.

getCall

public DatabaseCall getCall()
OBSOLETE: Return the call for this query. This call contains the SQL and argument list.
See Also:
getDatasourceCall()

getCalls

public java.util.List getCalls()
Deprecated. 
OBSOLETE: Return the calls for this query. Used for queries with multiple calls. This call contains the SQL and argument list.
See Also:
getDatasourceCalls();

getDatasourceCall

public Call getDatasourceCall()
ADVANCED: Return the call for this query. This call contains the SQL and argument list.
See Also:
prepareCall(Session, Record);

getDatasourceCalls

public java.util.List getDatasourceCalls()
ADVANCED: Return the calls for this query. This method can be called for queries with multiple calls This call contains the SQL and argument list.
See Also:
prepareCall(Session, Record);

getName

public java.lang.String getName()
Return the name of the query

getQueryTimeout

public int getQueryTimeout()
Return the number of seconds the driver will wait for a Statement to execute to the given number of seconds.
See Also:
DescriptorQueryManager.getQueryTimeout()

getRedirector

public QueryRedirector getRedirector()
Return the query redirector. A redirector can be used in a query to replace its execution with the execution of code. This can be used for named or parameterized queries to allow dynamic configuration of the query base on the query arguments.
See Also:
QueryRedirector

getReferenceClass

public java.lang.Class getReferenceClass()
Return the domain class associated with this query. By default this is null, but should be overridden in subclasses.

getSelectionCriteria

public Expression getSelectionCriteria()
Return the selection criteria of the query. This should only be used with expression queries, null will be returned for others.

getSessionName

public java.lang.String getSessionName()
Return the name of the session that the query should be executed under. This can be with the session broker to override the default session.

getSQLStatement

public oracle.toplink.internal.expressions.SQLStatement getSQLStatement()
Return the SQL statement of the query. This can only be used with statement queries.

getJPQLString

public java.lang.String getJPQLString()
Return the JPQL string of the query.

getEJBQLString

public java.lang.String getEJBQLString()
Return the EJBQL string of the query.

getHintString

public java.lang.String getHintString()
Return the current database hint string of the query.

getSQLString

public java.lang.String getSQLString()
ADVANCED: Return the SQL string of the query. This can be used for SQL queries. This can also be used for normal queries if they have been prepared, (i.e. query.prepareCall()).
See Also:
prepareCall(Session, Record)

getSQLStrings

public java.util.List getSQLStrings()
ADVANCED: Return the SQL strings of the query. Used for queries with multiple calls This can be used for SQL queries. This can also be used for normal queries if they have been prepared, (i.e. query.prepareCall()).
See Also:
prepareCall(Session, Record)

getTranslatedSQLString

public java.lang.String getTranslatedSQLString(Session session,
                                               Record translationRow)
ADVANCED: This can be used to access a queries translated SQL if they have been prepared, (i.e. query.prepareCall()). The Record argument is one of (Record, XMLRecord) that contains the query arguments.
See Also:
prepareCall(oracle.toplink.sessions.Session, Record)

getTranslatedSQLStrings

public java.util.List getTranslatedSQLStrings(Session session,
                                Record translationRow)
ADVANCED: This can be used to access a queries translated SQL if they have been prepared, (i.e. query.prepareCall()). This method can be used for queries with multiple calls.
See Also:
prepareCall(Session, Record)

hasSessionName

public boolean hasSessionName()
Return if a name of the session that the query should be executed under has been specified. This can be with the session broker to override the default session.

ignoreBindAllParameters

public void ignoreBindAllParameters()
Session's shouldBindAllParameters() defines whether to bind or not (default setting)

ignoreCacheStatement

public void ignoreCacheStatement()
Session's shouldCacheAllStatements() defines whether to cache or not (default setting)

isCallQuery

public boolean isCallQuery()
Return true if this query uses an SQL or stored procedure, or SDK call.

isDataModifyQuery

public boolean isDataModifyQuery()
Return if this is a data modify query.

isDataReadQuery

public boolean isDataReadQuery()
Return if this is a data read query.

isValueReadQuery

public boolean isValueReadQuery()
Return if this is a value read query.

isDirectReadQuery

public boolean isDirectReadQuery()
Return if this is a direct read query.

isDeleteAllQuery

public boolean isDeleteAllQuery()
Return if this is a delete all query.

isDeleteObjectQuery

public boolean isDeleteObjectQuery()
Return if this is a delete object query.

isExpressionQuery

public boolean isExpressionQuery()
Return true if this query uses an expression query mechanism

isModifyAllQuery

public boolean isModifyAllQuery()
Return true if this is a modify all query.

isModifyQuery

public boolean isModifyQuery()
Return true if this is a modify query.

isUpdateAllQuery

public boolean isUpdateAllQuery()
Return true if this is an update all query.

isUpdateObjectQuery

public boolean isUpdateObjectQuery()
Return true if this is an update object query.

getFlushOnExecute

public java.lang.Boolean getFlushOnExecute()
If executed against a RepeatableWriteUnitOfWork if this attribute is true TopLink will write changes to the database before executing the query.

isInsertObjectQuery

public boolean isInsertObjectQuery()
Return true if this is an insert object query.

isObjectLevelModifyQuery

public boolean isObjectLevelModifyQuery()
Return true if this is an object level modify query.

isObjectLevelReadQuery

public boolean isObjectLevelReadQuery()
Return true if this is an object level read query.

isObjectBuildingQuery

public boolean isObjectBuildingQuery()
Return if this is an object building query.

isReadAllQuery

public boolean isReadAllQuery()
Return true if this is a read all query.

isReadObjectQuery

public boolean isReadObjectQuery()
Return ture if this is a read object query.

isReadQuery

public boolean isReadQuery()
Return true if this is a read query.

isReportQuery

public boolean isReportQuery()
Return true if this is a report query.

isSQLCallQuery

public boolean isSQLCallQuery()
Return true if this query uses an SQL query mechanism .

isWriteObjectQuery

public boolean isWriteObjectQuery()
Return true if this is a write object query.

maintainCache

public void maintainCache()
Set for the identity map (cache) to be maintained. This is the default.

prepareCall

public void prepareCall(Session session,
                        Record translationRow)
                 throws QueryException
ADVANCED: Pre-generate the call/SQL for the query. This method takes a Session and an implementor of Record (DatebaseRow or XMLRecord). This can be used to access the SQL for a query without executing it. To access the call use, query.getCall(), or query.getSQLString() for the SQL. Note the SQL will have argument markers in it (i.e. "?"). To translate these use query.getTranslatedSQLString(session, translationRow).
Throws:
QueryException
See Also:
getCall(), getSQLString(), getTranslatedSQLString(oracle.toplink.sessions.Session, Record)

setDatasourceCall

public void setDatasourceCall(Call call)
Used to define a store procedure or SQL query.

setCall

public void setCall(Call call)
Used to define a store procedure or SQL query.

setJPQLString

public void setJPQLString(java.lang.String jpqlString)
Set the JPQL string of the query. If arguments are required in the string they will be preceeded by ":" then the argument name. The JPQL arguments must also be added as argument to the query.

setEJBQLString

public void setEJBQLString(java.lang.String ejbqlString)
Set the EJBQL string of the query. If arguments are required in the string they will be preceeded by "?" then the argument number.

setFlushOnExecute

public void setFlushOnExecute(java.lang.Boolean flushMode)
If executed against a RepeatableWriteUnitOfWork if this attribute is true TopLink will write changes to the database before executing the query.

setHintString

public void setHintString(java.lang.String newHintString)
Used to set the database hint string on the query. This should be the full hint string including the comment delimiters. This method will cause a query to re-prepare if it has already been executed.
Parameters:
newHintString - the hint string to be added into the SQL call.

setName

public void setName(java.lang.String queryName)
Set the query's name. Queries can be named and added to a descriptor or the session and then referenced by name.

setQueryTimeout

public void setQueryTimeout(int queryTimeout)
Set the number of seconds the driver will wait for a Statement to execute to the given number of seconds. If the limit is exceeded, a DatabaseException is thrown. queryTimeout - the new query timeout limit in seconds; DefaultTimeout is the default, which redirects to DescriptorQueryManager's queryTimeout.
See Also:
DescriptorQueryManager.setQueryTimeout(int)

setRedirector

public void setRedirector(QueryRedirector redirector)
Set the query redirector. A redirector can be used in a query to replace its execution with the execution of code. This can be used for named or parameterized queries to allow dynamic configuration of the query base on the query arguments.
See Also:
QueryRedirector

setSelectionCriteria

public void setSelectionCriteria(Expression expression)
To any user of this object. Set the selection criteria of the query. This method be used when dealing with expressions.

setSessionName

public void setSessionName(java.lang.String sessionName)
Set the name of the session that the query should be executed under. This can be with the session broker to override the default session.

setShouldBindAllParameters

public void setShouldBindAllParameters(boolean shouldBindAllParameters)
Bind all arguments to any SQL statement.

setShouldCacheStatement

public void setShouldCacheStatement(boolean shouldCacheStatement)
Cache the prepared statements, this requires full parameter binding as well.

setShouldMaintainCache

public void setShouldMaintainCache(boolean shouldMaintainCache)
Set if the identity map (cache) should be used or not. If not the cache check will be skipped and the result will not be put into the identity map. By default the identity map is always maintained.

setShouldPrepare

public void setShouldPrepare(boolean shouldPrepare)
Set if the query should be prepared. TopLink automatically prepares queries to generate their SQL only once, one each execution of the query the SQL does not need to be generated again only the arguments need to be translated. This option is provide to disable this optimization as in can cause problems with certain types of queries that require dynamic SQL basd on their arguments.

These queries include:


setShouldUseWrapperPolicy

public void setShouldUseWrapperPolicy(boolean shouldUseWrapperPolicy)
ADVANCED: The wrapper policy can be enable on a query.

setSQLStatement

public void setSQLStatement(oracle.toplink.internal.expressions.SQLStatement sqlStatement)
To any user of this object. Set the SQL statement of the query. This method should only be used when dealing with statement objects.

setSQLString

public void setSQLString(java.lang.String sqlString)
To any user of this object. Set the SQL string of the query. This method should only be used when dealing with user defined SQL strings. If arguments are required in the string they will be preceeded by "#" then the argument name. Warning: Allowing an unverified SQL string to be passed into this method makes your application vulnerable to SQL injection attacks.

shouldBindAllParameters

public boolean shouldBindAllParameters()
Bind all arguments to any SQL statement.

shouldCacheStatement

public boolean shouldCacheStatement()
Cache the prepared statements, this requires full parameter binding as well.

shouldCascadeAllParts

public boolean shouldCascadeAllParts()
Flag used to determine if all parts should be cascaded

shouldCascadeByMapping

public boolean shouldCascadeByMapping()
Mappings should be checked to determined if the current operation should be cascaded to the objects referenced.

shouldCascadeParts

public boolean shouldCascadeParts()
Flag used to determine if any parts should be cascaded

shouldCascadePrivateParts

public boolean shouldCascadePrivateParts()
Flag used to determine if any private parts should be cascaded

shouldIgnoreBindAllParameters

public boolean shouldIgnoreBindAllParameters()
Local shouldBindAllParameters() should be ignored, Session's shouldBindAllParameters() should be used.

shouldIgnoreCacheStatement

public boolean shouldIgnoreCacheStatement()
Local shouldCacheStatement() should be ignored, Session's shouldCacheAllStatements() should be used.

shouldMaintainCache

public boolean shouldMaintainCache()
Return if the identity map (cache) should be used or not. If not the cache check will be skipped and the result will not be put into the identity map. By default the identity map is always maintained.

shouldPrepare

public boolean shouldPrepare()
Return if the query should be prepared. TopLink automatically prepares queries to generate their SQL only once, one each execution of the query the SQL does not need to be generated again only the arguments need to be translated. This option is provide to disable this optimization as in can cause problems with certain types of queries that require dynamic SQL basd on their arguments.

These queries include:


shouldUseWrapperPolicy

public boolean shouldUseWrapperPolicy()
ADVANCED: The wrapper policy can be enabled on a query.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setIsNativeConnectionRequired

public void setIsNativeConnectionRequired(boolean isNativeConnectionRequired)
ADVANCED: Set if the descriptor requires usage of a native (unwrapped) JDBC connection. This may be required for some Oracle JDBC support when a wrapping DataSource is used.

isNativeConnectionRequired

public boolean isNativeConnectionRequired()
ADVANCED: Return if the descriptor requires usage of a native (unwrapped) JDBC connection. This may be required for some Oracle JDBC support when a wrapping DataSource is used.

Skip navigation links

Copyright © 1998, 2009, Oracle. All Rights Reserved.