Package org.eclipse.persistence.queries
Class WriteObjectQuery
- java.lang.Object
-
- org.eclipse.persistence.queries.DatabaseQuery
-
- org.eclipse.persistence.queries.ModifyQuery
-
- org.eclipse.persistence.queries.ObjectLevelModifyQuery
-
- 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:
- Determines whether to perform a insert or an update on the database.
- Stores object in identity map for insert if required.
- See Also:
- Serialized Form
- Author:
- Yvon Lavoie
- Since:
- TOPLink/Java 1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.queries.DatabaseQuery
DatabaseQuery.ParameterType
-
-
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, isBatchExecutionSupported, modifyRow
-
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
accessors, allowNativeSQLQuery, argumentFields, argumentParameterTypes, arguments, argumentTypeNames, argumentTypes, argumentValues, BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, descriptors, doNotRedirect, executionSession, flushOnExecute, hintString, isCustomQueryUsed, isExecutionClone, isNativeConnectionRequired, isPrepared, isUserDefined, isUserDefinedSQLCall, monitorName, name, NoCascading, nullableArguments, parameterDelimiter, partitioningPolicy, properties, queryMechanism, queryTimeout, queryTimeoutUnit, redirector, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, sourceMapping, translationRow
-
-
Constructor Summary
Constructors Constructor Description WriteObjectQuery()
WriteObjectQuery(java.lang.Object objectToWrite)
WriteObjectQuery(Call call)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, resetMonitorName, setBackupClone, setObject, setObjectChangeSet, setPrimaryKey, toString
-
Methods inherited from class org.eclipse.persistence.queries.ModifyQuery
forceBatchStatementExecution, getModifyRow, isBatchExecutionSupported, isModifyQuery, setForceBatchStatementExecution, setIsBatchExecutionSupported, setModifyRow
-
Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery
addArgument, addArgument, addArgument, addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkEarlyReturn, checkForCustomQuery, checkPrepare, checkPrepare, clone, clonedQueryExecutionComplete, convertClassNamesToClasses, copyFromQuery, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, extractRemoteResult, getAccessor, getAccessors, getArgumentParameterTypes, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getBatchObjects, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDescriptors, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getMonitorName, getName, getNullableArguments, getParameterDelimiter, getParameterDelimiterChar, getPartitioningPolicy, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getQueryTimeoutUnit, getRedirector, getRedirectorForQuery, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasNullableArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isCustomSelectionQuery, isDataModifyQuery, isDataReadQuery, isDefaultPropertiesQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isNativeConnectionRequired, isObjectBuildingQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isResultSetMappingQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isUserDefinedSQLCall, isValueReadQuery, maintainCache, prepareCall, prepareCustomQuery, prepareForRemoteExecution, prepareFromQuery, prepareInternal, redirectQuery, remoteExecute, remoteExecute, removeProperty, replaceValueHoldersIn, retrieveBypassCache, rowFromArguments, setAccessor, setAccessors, setAllowNativeSQLQuery, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setBatchObjects, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setExecutionSession, setFlushOnExecute, setHintString, setIsCustomQueryUsed, setIsExecutionClone, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setIsUserDefinedSQLCall, setJPQLString, setName, setNullableArguments, setParameterDelimiter, setPartitioningPolicy, setProperties, setProperty, setQueryMechanism, setQueryTimeout, setQueryTimeoutUnit, setRedirector, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldReturnGeneratedKeys, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setShouldValidateUpdateCallCacheUse, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldAllowNativeSQLQuery, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, storeBypassCache
-
-
-
-
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 classDatabaseQuery
- Returns:
- object - the object being written.
- Throws:
DatabaseException
- - an error has occurred on the databaseOptimisticLockException
- - 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.
-
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.
-
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 classDatabaseQuery
-
isWriteObjectQuery
public boolean isWriteObjectQuery()
PUBLIC: Return if this is a write object query.- Overrides:
isWriteObjectQuery
in classDatabaseQuery
-
prepareForExecution
public void prepareForExecution() throws QueryException
INTERNAL: Prepare the receiver for execution in a session.- Overrides:
prepareForExecution
in classObjectLevelModifyQuery
- Throws:
QueryException
-
-