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:
backupClone, object, objectChangeSet, primaryKey
forceBatchStatementExecution, modifyRow
accessor, arguments, argumentTypeNames, argumentTypes, argumentValues, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, flushOnExecute, isPrepared, isUserDefined, name, NoCascading, properties, queryMechanism, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldUseWrapperPolicy, translationRow
False, True, Undefined
Constructor and Description |
---|
WriteObjectQuery() |
WriteObjectQuery(Call call) |
WriteObjectQuery(Object objectToWrite) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
doesObjectExist()
INTERNAL:
Return if the object exists on the database or not.
|
void |
executeCommit()
INTERNAL:
Decide whether to perform an insert, update or delete 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.
|
Object |
executeDatabaseQuery()
INTERNAL:
Perform a does exist check to decide whether to perform an insert or update and
delegate the work to the mechanism.
|
void |
executeShallowWrite()
INTERNAL:
Perform a shallow write.
|
boolean |
isWriteObjectQuery()
PUBLIC:
Return if this is a write object query.
|
void |
prepareForExecution()
INTERNAL:
Prepare the receiver for execution in a session.
|
boolean |
shouldDependentObjectBeDeleted(Object object)
INTERNAL:
Return whether a dependent object should be deleted from the database or not.
|
protected boolean |
shouldObjectBeDeleted()
INTERNAL:
Return if the attached object should be deleted from the database or not.
|
checkDescriptor, executeInUnitOfWork, executeInUnitOfWorkObjectLevelModifyQuery, getBackupClone, getObject, getObjectChangeSet, getPrimaryKey, getReferenceClass, getReferenceClassName, isObjectLevelModifyQuery, prepare, setBackupClone, setObject, setObjectChangeSet, setPrimaryKey, toString
forceBatchStatementExecution, getModifyRow, isModifyQuery, setForceBatchStatementExecution, setModifyRow
addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkEarlyReturn, checkForCustomQuery, checkPrepare, clone, clonedQueryExecutionComplete, convertClassNamesToClasses, deploymentSetShouldMaintainCache, deploymentShouldMaintainCache, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, getAccessor, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getEJBQLString, getFlushOnExecute, getName, getProperties, getProperty, getQueryMechanism, getSelectionCriteria, getSession, getSessionName, getShouldBindAllParameters, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isDataModifyQuery, isDataReadQuery, isDeleteAllQuery, isDeleteObjectQuery, isExpressionQuery, isInsertObjectQuery, isModifyAllQuery, isObjectBuildingQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, maintainCache, prepareCall, prepareCustomQuery, prepareForRemoteExecution, removeProperty, rowFromArguments, setAccessor, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setEJBQLString, setFlushOnExecute, setIsPrepared, setIsUserDefined, setName, setProperties, setProperty, setQueryMechanism, 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
public WriteObjectQuery()
public WriteObjectQuery(Object objectToWrite)
public WriteObjectQuery(Call call)
protected boolean doesObjectExist()
public Object executeDatabaseQuery() throws DatabaseException, OptimisticLockException
executeDatabaseQuery
in class DatabaseQuery
DatabaseException
- - an error has occurred on the databaseOptimisticLockException
- - an error has occurred using the optimistic lock featurepublic void executeCommit() throws DatabaseException, OptimisticLockException
public void executeCommitWithChangeSet() throws DatabaseException, OptimisticLockException
public void executeShallowWrite()
this.executeCommit
.public boolean isWriteObjectQuery()
isWriteObjectQuery
in class DatabaseQuery
public void prepareForExecution() throws QueryException
prepareForExecution
in class ObjectLevelModifyQuery
QueryException
public boolean shouldDependentObjectBeDeleted(Object object)
protected boolean shouldObjectBeDeleted()
Copyright © 2022. All rights reserved.