Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.queryframework
Class DoesExistQuery

java.lang.Object
  extended byoracle.toplink.queryframework.DatabaseQuery
      extended byoracle.toplink.queryframework.DoesExistQuery

All Implemented Interfaces:
java.lang.Cloneable, oracle.toplink.internal.helper.FalseUndefinedTrue, java.io.Serializable

public class DoesExistQuery
extends DatabaseQuery

Purpose: This should only be used by the descriptor, this should not be executed directly. Used to determine if an object resides on the database. DoesExistQuery is normally used to determine whether to make an update or insert statement when writing an object.

Responsibilities: Verify the existence of an object. Used only by a write object query.

Since:
TOPLink/Java 1.0
See Also:
Serialized Form

Field Summary

Fields inherited from class oracle.toplink.queryframework.DatabaseQuery
CascadeAggregateDelete, CascadeAllParts, CascadeDependentParts, CascadePrivateParts, NoCascading, QUERY_PREPARE

Constructor Summary
DoesExistQuery()
PUBLIC: Initialize the state of the query .
DoesExistQuery(java.lang.Object object)
PUBLIC: Create a query to check if the object exists.

Method Summary
void assumeExistenceForDoesExist()
PUBLIC: Assume that if the objects primary key does not include null then it must exist.
void assumeNonExistenceForDoesExist()
PUBLIC: Assume that the object does not exist.
void checkCacheForDoesExist()
PUBLIC: Assume that if the objects primary key does not include null and it is in the cache, then is must exist.
void checkDatabaseForDoesExist()
PUBLIC: Perform does exist check on the database through slecting the primary key.
java.lang.Object getObject()
PUBLIC: Return the object.
java.lang.Class getReferenceClass()
Return the domain class associated with this query.
void setObject(java.lang.Object object)
PUBLIC: Set the object.
boolean shouldAssumeExistenceForDoesExist()
PUBLIC: Returns true if the does exist check should be based only on whether the primary key of the object is set
boolean shouldAssumeNonExistenceForDoesExist()
PUBLIC: Returns true if the does exist check should assume non existence.
boolean shouldCheckCacheForDoesExist()
PUBLIC: Returns true if the does exist check should be based only on a cache check.
boolean shouldCheckDatabaseForDoesExist()
PUBLIC: Returns true if the does exist check should query the database.

Methods inherited from class oracle.toplink.queryframework.DatabaseQuery
addArgument, addArgument, addArgument, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, cacheStatement, cascadeAllParts, cascadePrivateParts, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, getCall, getEJBQLString, getHintString, getName, getQueryTimeout, getRedirector, getSelectionCriteria, getSessionName, getSQLStatement, getSQLString, getTranslatedSQLString, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isDataModifyQuery, isDataReadQuery, isDeleteObjectQuery, isExpressionQuery, isModifyQuery, isObjectLevelModifyQuery, isObjectLevelReadQuery, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isSQLCallQuery, isWriteObjectQuery, maintainCache, prepareCall, setCall, setEJBQLString, setHintString, setName, setQueryTimeout, setRedirector, setSelectionCriteria, setSessionName, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldUseWrapperPolicy, setSQLStatement, setSQLString, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeParts, shouldCascadePrivateParts, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldUseWrapperPolicy, toString

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

Constructor Detail

DoesExistQuery

public DoesExistQuery()
PUBLIC: Initialize the state of the query . By default the cache is checked, if non cache is used the descriptor should throw a exception and validate.

DoesExistQuery

public DoesExistQuery(java.lang.Object object)
PUBLIC: Create a query to check if the object exists.

Method Detail

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 user's system garentees that an object with non-null key exists.

assumeNonExistenceForDoesExist

public void assumeNonExistenceForDoesExist()
PUBLIC: Assume that the object does not exist. This may be used if the user's system garentees objects must always be inserted.

checkCacheForDoesExist

public void checkCacheForDoesExist()
PUBLIC: Assume that if the objects primary key does not include null and it is in the cache, then is must exist. This should only be used if a full identity map is being used, and a new object in the client cannot have been inserted by another client.

checkDatabaseForDoesExist

public void checkDatabaseForDoesExist()
PUBLIC: Perform does exist check on the database through slecting the primary key.

getObject

public java.lang.Object getObject()
PUBLIC: Return the object.

getReferenceClass

public java.lang.Class getReferenceClass()
Return the domain class associated with this query.
Overrides:
getReferenceClass in class DatabaseQuery

setObject

public void setObject(java.lang.Object object)
PUBLIC: Set the object.

shouldAssumeExistenceForDoesExist

public boolean shouldAssumeExistenceForDoesExist()
PUBLIC: Returns true if the does exist check should be based only on whether the primary key of the object is set

shouldAssumeNonExistenceForDoesExist

public boolean shouldAssumeNonExistenceForDoesExist()
PUBLIC: Returns true if the does exist check should assume non existence.

shouldCheckCacheForDoesExist

public boolean shouldCheckCacheForDoesExist()
PUBLIC: Returns true if the does exist check should be based only on a cache check. Default behavior.

shouldCheckDatabaseForDoesExist

public boolean shouldCheckDatabaseForDoesExist()
PUBLIC: Returns true if the does exist check should query the database.

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.