Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.queryframework
Class DatabaseQuery

`java.lang.Object
oracle.toplink.queryframework.DatabaseQuery`

All Implemented Interfaces:
  java.lang.Cloneable, java.io.Serializable

Direct Known Subclasses:
  DoesExistQuery, ModifyQuery, ReadQuery

public abstract class DatabaseQuery
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

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:

- Provide a common protocol for query objects.
- Defines a generic execution interface.
- Provides query property values
- Holds arguments to the query

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()` PUBLIC: Initialize the state of the query

Method Summary
`void` | `addArgument(java.lang.String argumentName)` PUBLIC: Add the argument named argumentName.
`void` | `addArgument(java.lang.String argumentName, java.lang.Class type)` PUBLIC: Add the argument named argumentName and its class type.
`void` | `addArgument(java.lang.String argumentName, java.lang.String typeAsString)` PUBLIC: Add the argument named argumentName and its class type.
`void` | `addArgumentValue(java.lang.Object argumentValue)` PUBLIC: Add the argumentValue.
`void` | `addArgumentValues(java.util.Vector theArgumentValues)` PUBLIC: Add the argumentValues to the query.
`void` | `addCall(Call call)` PUBLIC: Used to define a store procedure or SQL query.
`void` | `addStatement(SQLStatement statement)` PUBLIC: Used to define a statement level query.
`void` | `bindAllParameters()` PUBLIC: Bind all arguments to any SQL statement.
`void` | `cacheStatement()` PUBLIC: Cache the prepared statements, this requires full parameter binding as well.
`void` | `cascadeAllParts()` PUBLIC: Cascade the query and its properties on the queries object(s) and all objects related to the queries object(s).
`void` | `cascadeByMapping()` PUBLIC: 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()` PUBLIC: Cascade the query and its properties on the queries object(s) and all privately owned objects related to the queries object(s).
`void` | `dontBindAllParameters()` PUBLIC: Do not Bind all arguments to any SQL statement.
`void` | `dontCacheStatement()` PUBLIC: Dont cache the prepared statements, this requires full parameter binding as well.
`void` | `dontCascadeParts()` PUBLIC: Do not cascade the query and its properties on the queries object(s) relationships.
`void` | `dontMaintainCache()` PUBLIC: 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()` PUBLIC: Return the SQL string of the query.
`java.lang.String` | `getHintString()` PUBLIC: Return the current Oracle Hint string of the query
`java.lang.String` | `getName()` PUBLIC: Return the name of the query
`int` | `getQueryTimeout()` PUBLIC: Return the number of seconds the driver will wait for a Statement to execute to the given number of seconds.
`QueryRedirector` | `getRedirector()` PUBLIC: Return the query redirector.
`java.lang.Class` | `getReferenceClass()` PUBLIC: Return the domain class associated with this query.
`Expression` | `getSelectionCriteria()` PUBLIC: Return the selection criteria of the query.
`java.lang.String` | `getSessionName()` PUBLIC: Return the name of the session that the query should be executed under.
`SQLStatement` | `getSQLStatement()` PUBLIC: Return the SQL statement of the query.
`java.lang.String` | `getSQLString()` PUBLIC: Return the SQL string of the query.
`java.util.List` | `getSQLStrings()` PUBLIC: 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()` PUBLIC: Return if a name of the session that the query should be executed under has been specified.
`void` | `ignoreBindAllParameters()` PUBLIC: Session's shouldBindAllParameters() defines whether to bind or not (default setting)
`void` | `ignoreCacheStatement()` PUBLIC: Session's shouldCacheAllStatements() defines whether to cache or not (default setting)
`boolean` | `isCallQuery()` PUBLIC: Return true if this query uses an SQL or stored procedure, or SDK call.
`boolean` | `isDataModifyQuery()` PUBLIC: Return if this is a data modify query.
`boolean` | `isDataReadQuery()` PUBLIC: Return if this is a data read query.
`boolean` | `isDeleteObjectQuery()` PUBLIC: Return if this is a delete object query.
`boolean` | `isExpressionQuery()` PUBLIC: Return true if this query uses an expression query mechanism
`boolean` | `isInsertObjectQuery()` PUBLIC: Return true if this is an insert object query.
`boolean` | `isModifyQuery()` PUBLIC: Return true if this is a modify query.
`boolean` | `isObjectLevelModifyQuery()` PUBLIC: Return true if this is an object level modify query.
`boolean` | `isObjectLevelReadQuery()` PUBLIC: Return true if this is an object level read query.
`boolean` | `isReadAllQuery()` PUBLIC: Return true if this is a read all query.
`boolean` | `isReadObjectQuery()` PUBLIC: Return ture if this is a read object query.
`boolean` | `isReadQuery()` PUBLIC: Return true if this is a read query.
`boolean` | `isReportQuery()` PUBLIC: Return true if this is a report query.
`boolean` | `isSQLCallQuery()` PUBLIC: Return true if this query uses an SQL query mechanism .
`boolean` | `isUpdateAllQuery()` PUBLIC: Return true if this is an update all query.
`boolean` | `isUpdateObjectQuery()` PUBLIC: Return true if this is an update object query.
`boolean` | `isWriteObjectQuery()` PUBLIC: Return true if this is a write object query.
`void` | `maintainCache()` PUBLIC: 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)` PUBLIC: Used to define a store procedure or SQL query.
`void` | `setDatasourceCall(Call call)` PUBLIC: Used to define a store procedure or SQL query.
`void` | `setEJBQLString(java.lang.String ejbqlString)` PUBLIC: To any user of this object.
`void` | `setHintString(java.lang.String newHintString)` PUBLIC: Used to set the Oracle Hint string on the query.
`void` | `setName(java.lang.String queryName)` PUBLIC: Set the query's name.
`void` | `setQueryTimeout(int queryTimeout)` PUBLIC: Set the number of seconds the driver will wait for a Statement to execute to the given number of seconds.
`void` | `setRedirector(QueryRedirector redirector)` PUBLIC: Set the query redirector.
`void` | `setSelectionCriteria(Expression expression)` PUBLIC: To any user of this object.
`void` | `setSessionName(java.lang.String sessionName)` PUBLIC: Set the name of the session that the query should be executed under.
`void` | `setShouldBindAllParameters(boolean shouldBindAllParameters)` PUBLIC: Bind all arguments to any SQL statement.
`void` | `setShouldCacheStatement(boolean shouldCacheStatement)` PUBLIC: Cache the prepared statements, this requires full parameter binding as well.
`void` | `setShouldMaintainCache(boolean shouldMaintainCache)` PUBLIC: Set if the identity map (cache) should be used or not.
`void` | `setShouldPrepare(boolean shouldPrepare)` PUBLIC: Set if the query should be prepared.
`void` | `setShouldUseWrapperPolicy(boolean shouldUseWrapperPolicy)` ADVANCED: The wrapper policy can be enable on a query.
`void` | `setSQLStatement(SQLStatement sqlStatement)` PUBLIC: To any user of this object.
`void` | `setSQLString(java.lang.String sqlString)` PUBLIC: To any user of this object.
`boolean` | `shouldBindAllParameters()` PUBLIC: Bind all arguments to any SQL statement.
`boolean` | `shouldCacheStatement()` PUBLIC: Cache the prepared statements, this requires full parameter binding as well.
`boolean` | `shouldCascadeAllParts()` PUBLIC: Flag used to determine if all parts should be cascaded
`boolean` | `shouldCascadeByMapping()` PUBLIC: Mappings should be checked to determined if the current operation should be cascaded to the objects referenced.
`boolean` | `shouldCascadeParts()` PUBLIC: Flag used to determine if any parts should be cascaded
`boolean` | `shouldCascadePrivateParts()` PUBLIC: Flag used to determine if any private parts should be cascaded
`boolean` | `shouldIgnoreBindAllParameters()` PUBLIC: Local shouldBindAllParameters() should be ignored, Session's shouldBindAllParameters() should be used.
`boolean` | `shouldIgnoreCacheStatement()` PUBLIC: Local shouldCacheStatement() should be ignored, Session's shouldCacheAllStatements() should be used.
`boolean` | `shouldMaintainCache()` PUBLIC: Return if the identity map (cache) should be used or not.
`boolean` | `shouldPrepare()` PUBLIC: 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()

  PUBLIC: Initialize the state of the query

Method Detail

### addArgument

    public void addArgument(java.lang.String argumentName)

  PUBLIC: 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)

  PUBLIC: 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)

  PUBLIC: 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)

  PUBLIC: Add the argumentValue. Argument values must be added in the same order the arguments are defined.

### addArgumentValues

    public void addArgumentValues(java.util.Vector theArgumentValues)

  PUBLIC: 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)

  PUBLIC: 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(SQLStatement statement)

  PUBLIC: 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()

  PUBLIC: Bind all arguments to any SQL statement.

### cacheStatement

    public void cacheStatement()

  PUBLIC: Cache the prepared statements, this requires full parameter binding as well.

### cascadeAllParts

    public void cascadeAllParts()

  PUBLIC: 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()

  PUBLIC: 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()

  PUBLIC: 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()

  PUBLIC: Do not Bind all arguments to any SQL statement.

### dontCacheStatement

    public void dontCacheStatement()

  PUBLIC: Dont cache the prepared statements, this requires full parameter binding as well.

### dontCascadeParts

    public void dontCascadeParts()

  PUBLIC: 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()

  PUBLIC: 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, DatabaseRow);`

### 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, DatabaseRow);`

### getName

    public java.lang.String getName()

  PUBLIC: Return the name of the query

### getQueryTimeout

    public int getQueryTimeout()

  PUBLIC: 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()

  PUBLIC: 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()

  PUBLIC: Return the domain class associated with this query. By default this is null, but should be overridden in subclasses.

### getSelectionCriteria

    public Expression getSelectionCriteria()

  PUBLIC: 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()

  PUBLIC: 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 SQLStatement getSQLStatement()

  PUBLIC: Return the SQL statement of the query. This can only be used with statement queries.

### getEJBQLString

    public java.lang.String getEJBQLString()

  PUBLIC: Return the SQL string of the query. This can be used for SQL queries. ADVANCED: This can also be used for normal queries if they have been prepared, (i.e. query.prepareCall()).
  See Also:
    `#prepareCall(Session, DatabaseRow)`

### getHintString

    public java.lang.String getHintString()

  PUBLIC: Return the current Oracle Hint string of the query
  Returns:
    String - The hint string for this query

### getSQLString

    public java.lang.String getSQLString()

  PUBLIC: Return the SQL string of the query. This can be used for SQL queries. ADVANCED: This can also be used for normal queries if they have been prepared, (i.e. query.prepareCall()).
  See Also:
    `#prepareCall(Session, DatabaseRow)`

### getSQLStrings

    public java.util.List getSQLStrings()

  PUBLIC: Return the SQL strings of the query. Used for queries with multiple calls This can be used for SQL queries. ADVANCED: This can also be used for normal queries if they have been prepared, (i.e. query.prepareCall()).
  See Also:
    `#prepareCall(Session, DatabaseRow)`

### 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 (DatabaseRow, 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, DatabaseRow)`

### hasSessionName

    public boolean hasSessionName()

  PUBLIC: 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()

  PUBLIC: Session's shouldBindAllParameters() defines whether to bind or not (default setting)

### ignoreCacheStatement

    public void ignoreCacheStatement()

  PUBLIC: Session's shouldCacheAllStatements() defines whether to cache or not (default setting)

### isCallQuery

    public boolean isCallQuery()

  PUBLIC: Return true if this query uses an SQL or stored procedure, or SDK call.

### isDataModifyQuery

    public boolean isDataModifyQuery()

  PUBLIC: Return if this is a data modify query.

### isDataReadQuery

    public boolean isDataReadQuery()

  PUBLIC: Return if this is a data read query.

### isDeleteObjectQuery

    public boolean isDeleteObjectQuery()

  PUBLIC: Return if this is a delete object query.

### isExpressionQuery

    public boolean isExpressionQuery()

  PUBLIC: Return true if this query uses an expression query mechanism

### isModifyQuery

    public boolean isModifyQuery()

  PUBLIC: Return true if this is a modify query.

### isUpdateAllQuery

    public boolean isUpdateAllQuery()

  PUBLIC: Return true if this is an update all query.

### isUpdateObjectQuery

    public boolean isUpdateObjectQuery()

  PUBLIC: Return true if this is an update object query.

### isInsertObjectQuery

    public boolean isInsertObjectQuery()

  PUBLIC: Return true if this is an insert object query.

### isObjectLevelModifyQuery

    public boolean isObjectLevelModifyQuery()

  PUBLIC: Return true if this is an object level modify query.

### isObjectLevelReadQuery

    public boolean isObjectLevelReadQuery()

  PUBLIC: Return true if this is an object level read query.

### isReadAllQuery

    public boolean isReadAllQuery()

  PUBLIC: Return true if this is a read all query.

### isReadObjectQuery

    public boolean isReadObjectQuery()

  PUBLIC: Return ture if this is a read object query.

### isReadQuery

    public boolean isReadQuery()

  PUBLIC: Return true if this is a read query.

### isReportQuery

    public boolean isReportQuery()

  PUBLIC: Return true if this is a report query.

### isSQLCallQuery

    public boolean isSQLCallQuery()

  PUBLIC: Return true if this query uses an SQL query mechanism .

### isWriteObjectQuery

    public boolean isWriteObjectQuery()

  PUBLIC: Return true if this is a write object query.

### maintainCache

    public void maintainCache()

  PUBLIC: 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)

  PUBLIC: Used to define a store procedure or SQL query.

### setCall

    public void setCall(Call call)

  PUBLIC: Used to define a store procedure or SQL query.

### setEJBQLString

    public void setEJBQLString(java.lang.String ejbqlString)

  PUBLIC: To any user of this object. Set the EJBQL string of the query. If arguments are required in the string they will be preceeded by "?" then the argument number.

### setHintString

    public void setHintString(java.lang.String newHintString)

  PUBLIC: Used to set the Oracle 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

### setName

    public void setName(java.lang.String queryName)

  PUBLIC: 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)

  PUBLIC: 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 queryTimeout)`

### setRedirector

    public void setRedirector(QueryRedirector redirector)

  PUBLIC: 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)

  PUBLIC: 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)

  PUBLIC: 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)

  PUBLIC: Bind all arguments to any SQL statement.

### setShouldCacheStatement

    public void setShouldCacheStatement(boolean shouldCacheStatement)

  PUBLIC: Cache the prepared statements, this requires full parameter binding as well.

### setShouldMaintainCache

    public void setShouldMaintainCache(boolean shouldMaintainCache)

  PUBLIC: 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)

  PUBLIC: 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:

  - Expressions that make use of 'equal' where the argument value has the potential to be null, this can cause problems on databases that require IS NULL, instead of = NULL.
  - Expressions that make use of 'in' and that use parameter binding, this will cause problems as the in values must be bound individually.

### setShouldUseWrapperPolicy

    public void setShouldUseWrapperPolicy(boolean shouldUseWrapperPolicy)

  ADVANCED: The wrapper policy can be enable on a query.

### setSQLStatement

    public void setSQLStatement(SQLStatement sqlStatement)

  PUBLIC: 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)

  PUBLIC: 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()

  PUBLIC: Bind all arguments to any SQL statement.

### shouldCacheStatement

    public boolean shouldCacheStatement()

  PUBLIC: Cache the prepared statements, this requires full parameter binding as well.

### shouldCascadeAllParts

    public boolean shouldCascadeAllParts()

  PUBLIC: Flag used to determine if all parts should be cascaded

### shouldCascadeByMapping

    public boolean shouldCascadeByMapping()

  PUBLIC: Mappings should be checked to determined if the current operation should be cascaded to the objects referenced.

### shouldCascadeParts

    public boolean shouldCascadeParts()

  PUBLIC: Flag used to determine if any parts should be cascaded

### shouldCascadePrivateParts

    public boolean shouldCascadePrivateParts()

  PUBLIC: Flag used to determine if any private parts should be cascaded

### shouldIgnoreBindAllParameters

    public boolean shouldIgnoreBindAllParameters()

  PUBLIC: Local shouldBindAllParameters() should be ignored, Session's shouldBindAllParameters() should be used.

### shouldIgnoreCacheStatement

    public boolean shouldIgnoreCacheStatement()

  PUBLIC: Local shouldCacheStatement() should be ignored, Session's shouldCacheAllStatements() should be used.

### shouldMaintainCache

    public boolean shouldMaintainCache()

  PUBLIC: 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()

  PUBLIC: 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:

  - Expressions that make use of 'equal' where the argument value has the potential to be null, this can cause problems on databases that require IS NULL, instead of = NULL.
  - Expressions that make use of 'in' and that use parameter binding, this will cause problems as the in values must be bound individually.

### shouldUseWrapperPolicy

    public boolean shouldUseWrapperPolicy()

  ADVANCED: The wrapper policy can be enabled on a query.

### toString

    public java.lang.String toString()

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD