|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) B32476-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.toplink.queryframework.DatabaseQuery
public abstract class DatabaseQuery
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:
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 |
---|
public static final int NoCascading
public static final int CascadePrivateParts
public static final int CascadeAllParts
public static final int CascadeDependentParts
public static final int CascadeAggregateDelete
public static final int CascadeByMapping
Constructor Detail |
---|
public DatabaseQuery()
Method Detail |
---|
public void addArgument(java.lang.String argumentName)
public void addArgument(java.lang.String argumentName, java.lang.Class type)
public void addArgument(java.lang.String argumentName, java.lang.String typeAsString)
public void addArgumentValue(java.lang.Object argumentValue)
public void addArgumentValues(java.util.Vector theArgumentValues)
public void addCall(Call call)
public void addStatement(oracle.toplink.internal.expressions.SQLStatement statement)
public void bindAllParameters()
public void cacheStatement()
public void cascadeAllParts()
public void cascadeByMapping()
public void cascadePrivateParts()
public void dontBindAllParameters()
public void dontCacheStatement()
public void dontCascadeParts()
public void dontMaintainCache()
public DatabaseCall getCall()
getDatasourceCall()
public java.util.List getCalls()
getDatasourceCalls();
public Call getDatasourceCall()
prepareCall(Session, Record);
public java.util.List getDatasourceCalls()
prepareCall(Session, Record);
public java.lang.String getName()
public int getQueryTimeout()
DescriptorQueryManager.getQueryTimeout()
public QueryRedirector getRedirector()
QueryRedirector
public java.lang.Class getReferenceClass()
public Expression getSelectionCriteria()
public java.lang.String getSessionName()
public oracle.toplink.internal.expressions.SQLStatement getSQLStatement()
public java.lang.String getJPQLString()
public java.lang.String getEJBQLString()
public java.lang.String getHintString()
public java.lang.String getSQLString()
prepareCall(Session, Record)
public java.util.List getSQLStrings()
prepareCall(Session, Record)
public java.lang.String getTranslatedSQLString(Session session, Record translationRow)
prepareCall(oracle.toplink.sessions.Session, Record)
public java.util.List getTranslatedSQLStrings(Session session, Record translationRow)
prepareCall(Session, Record)
public boolean hasSessionName()
public void ignoreBindAllParameters()
public void ignoreCacheStatement()
public boolean isCallQuery()
public boolean isDataModifyQuery()
public boolean isDataReadQuery()
public boolean isValueReadQuery()
public boolean isDirectReadQuery()
public boolean isDeleteAllQuery()
public boolean isDeleteObjectQuery()
public boolean isExpressionQuery()
public boolean isModifyAllQuery()
public boolean isModifyQuery()
public boolean isUpdateAllQuery()
public boolean isUpdateObjectQuery()
public java.lang.Boolean getFlushOnExecute()
public boolean isInsertObjectQuery()
public boolean isObjectLevelModifyQuery()
public boolean isObjectLevelReadQuery()
public boolean isObjectBuildingQuery()
public boolean isReadAllQuery()
public boolean isReadObjectQuery()
public boolean isReadQuery()
public boolean isReportQuery()
public boolean isSQLCallQuery()
public boolean isWriteObjectQuery()
public void maintainCache()
public void prepareCall(Session session, Record translationRow) throws QueryException
QueryException
getCall()
,
getSQLString()
,
getTranslatedSQLString(oracle.toplink.sessions.Session, Record)
public void setDatasourceCall(Call call)
public void setCall(Call call)
public void setJPQLString(java.lang.String jpqlString)
public void setEJBQLString(java.lang.String ejbqlString)
public void setFlushOnExecute(java.lang.Boolean flushMode)
public void setHintString(java.lang.String newHintString)
newHintString
- the hint string to be added into the SQL call.public void setName(java.lang.String queryName)
public void setQueryTimeout(int queryTimeout)
DescriptorQueryManager.setQueryTimeout(int)
public void setRedirector(QueryRedirector redirector)
QueryRedirector
public void setSelectionCriteria(Expression expression)
public void setSessionName(java.lang.String sessionName)
public void setShouldBindAllParameters(boolean shouldBindAllParameters)
public void setShouldCacheStatement(boolean shouldCacheStatement)
public void setShouldMaintainCache(boolean shouldMaintainCache)
public void setShouldPrepare(boolean shouldPrepare)
These queries include:
public void setShouldUseWrapperPolicy(boolean shouldUseWrapperPolicy)
public void setSQLStatement(oracle.toplink.internal.expressions.SQLStatement sqlStatement)
public void setSQLString(java.lang.String sqlString)
public boolean shouldBindAllParameters()
public boolean shouldCacheStatement()
public boolean shouldCascadeAllParts()
public boolean shouldCascadeByMapping()
public boolean shouldCascadeParts()
public boolean shouldCascadePrivateParts()
public boolean shouldIgnoreBindAllParameters()
public boolean shouldIgnoreCacheStatement()
public boolean shouldMaintainCache()
public boolean shouldPrepare()
These queries include:
public boolean shouldUseWrapperPolicy()
public java.lang.String toString()
toString
in class java.lang.Object
public void setIsNativeConnectionRequired(boolean isNativeConnectionRequired)
public boolean isNativeConnectionRequired()
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |