EclipseLink1.0 - 20080707 API Reference

org.eclipse.persistence.queries
Class WriteObjectQuery

java.lang.Object
  extended by org.eclipse.persistence.queries.DatabaseQuery
      extended by org.eclipse.persistence.queries.ModifyQuery
          extended by org.eclipse.persistence.queries.ObjectLevelModifyQuery
              extended by org.eclipse.persistence.queries.WriteObjectQuery
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
InsertObjectQuery, UpdateObjectQuery

public class WriteObjectQuery
extends ObjectLevelModifyQuery

Purpose: Used for inserting or updating objects WriteObjectQuery determines whether to perform a insert or an update on the database.

Responsibilities:

See Also:
Serialized Form
Author:
Yvon Lavoie
Since:
TOPLink/Java 1.0

Field Summary
 
Fields inherited from class org.eclipse.persistence.queries.ObjectLevelModifyQuery
backupClone, object, objectChangeSet, primaryKey
 
Fields inherited from class org.eclipse.persistence.queries.ModifyQuery
forceBatchStatementExecution, modifyRow
 
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
accessor, arguments, argumentTypeNames, argumentTypes, argumentValues, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, doNotRedirect, executionSession, flushOnExecute, hintString, isCustomQueryUsed, isExecutionClone, isFromParseCache, isNativeConnectionRequired, isPrepared, isUserDefined, name, NoCascading, properties, queryMechanism, queryTimeout, redirector, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldUseWrapperPolicy, translationRow
 
Constructor Summary
WriteObjectQuery()
           
WriteObjectQuery(Call call)
           
WriteObjectQuery(java.lang.Object objectToWrite)
           
 
Method Summary
 void executeCommit()
          INTERNAL: Perform a does exist check to decide whether to perform an insert or update and delegate the work to the mechanism.
 void executeCommitWithChangeSet()
          INTERNAL: Perform a does exist check to decide whether to perform an insert or update and delegate the work to the mechanism.
 java.lang.Object executeDatabaseQuery()
          INTERNAL: Perform a does exist check to decide whether to perform an insert or update and delegate the work to the mechanism.
protected  QueryRedirector getDefaultRedirector()
          INTERNAL: Returns the specific default redirector for this query type.
 boolean isWriteObjectQuery()
          PUBLIC: Return if this is a write object query.
 void prepareForExecution()
          INTERNAL: Prepare the receiver for execution in a session.
 
Methods inherited from class org.eclipse.persistence.queries.ObjectLevelModifyQuery
checkDescriptor, executeInUnitOfWork, executeInUnitOfWorkObjectLevelModifyQuery, getBackupClone, getObject, getObjectChangeSet, getPrimaryKey, getReferenceClass, getReferenceClassName, isObjectLevelModifyQuery, prepare, setBackupClone, setObject, setObjectChangeSet, setPrimaryKey, toString
 
Methods inherited from class org.eclipse.persistence.queries.ModifyQuery
forceBatchStatementExecution, getModifyRow, isModifyQuery, setForceBatchStatementExecution, setModifyRow
 
Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery
addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkEarlyReturn, checkForCustomQuery, checkPrepare, checkPrepare, clone, clonedQueryExecutionComplete, convertClassNamesToClasses, copyFromQuery, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, extractRemoteResult, getAccessor, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getName, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getRedirector, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isCustomSelectionQuery, isDataModifyQuery, isDataReadQuery, isDefaultPropertiesQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isFromParseCache, isInsertObjectQuery, isModifyAllQuery, isNativeConnectionRequired, isObjectBuildingQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isValueReadQuery, maintainCache, prepareCall, prepareCustomQuery, prepareForRemoteExecution, prepareFromQuery, redirectQuery, remoteExecute, remoteExecute, removeProperty, replaceValueHoldersIn, rowFromArguments, setAccessor, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setExecutionSession, setFlushOnExecute, setHintString, setIsCustomQueryUsed, setIsExecutionClone, setIsFromParseCache, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setJPQLString, setName, setProperties, setProperty, setQueryMechanism, setQueryTimeout, setRedirector, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldUseWrapperPolicy, setSQLStatement, setSQLString, setTranslationRow, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldUseWrapperPolicy
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WriteObjectQuery

public WriteObjectQuery()

WriteObjectQuery

public WriteObjectQuery(java.lang.Object objectToWrite)

WriteObjectQuery

public WriteObjectQuery(Call call)
Method Detail

executeDatabaseQuery

public java.lang.Object executeDatabaseQuery()
                                      throws DatabaseException,
                                             OptimisticLockException
INTERNAL: Perform a does exist check to decide whether to perform an insert or update and delegate the work to the mechanism. Does exists check will also perform an optimistic lock check if required.

Specified by:
executeDatabaseQuery in class DatabaseQuery
Returns:
object - the object being written.
Throws:
DatabaseException - - an error has occurred on the database
OptimisticLockException - - an error has occurred using the optimistic lock feature

executeCommit

public void executeCommit()
                   throws DatabaseException,
                          OptimisticLockException
INTERNAL: Perform a does exist check to decide whether to perform an insert or update and delegate the work to the mechanism.

Throws:
DatabaseException
OptimisticLockException

executeCommitWithChangeSet

public void executeCommitWithChangeSet()
                                throws DatabaseException,
                                       OptimisticLockException
INTERNAL: Perform a does exist check to decide whether to perform an insert or update and delegate the work to the mechanism.

Throws:
DatabaseException
OptimisticLockException

getDefaultRedirector

protected QueryRedirector getDefaultRedirector()
INTERNAL: Returns the specific default redirector for this query type. There are numerous default query redirectors. See ClassDescriptor for their types.

Overrides:
getDefaultRedirector in class DatabaseQuery

isWriteObjectQuery

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

Overrides:
isWriteObjectQuery in class DatabaseQuery

prepareForExecution

public void prepareForExecution()
                         throws QueryException
INTERNAL: Prepare the receiver for execution in a session.

Overrides:
prepareForExecution in class ObjectLevelModifyQuery
Throws:
QueryException

EclipseLink1.0 - 20080707 API Reference