Top Description Fields Constructors Methods
org.eclipse.persistence.queries

public Class WriteObjectQuery

extends ObjectLevelModifyQuery
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.queries.InsertObjectQuery, org.eclipse.persistence.queries.UpdateObjectQuery
Imports
org.eclipse.persistence.exceptions.*, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl

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

Responsibilities:

Author
Yvon Lavoie
Since
TOPLink/Java 1.0

Field Summary

Inherited from org.eclipse.persistence.queries.ObjectLevelModifyQuery:
backupCloneobjectobjectChangeSetprimaryKey

Constructor Summary

AccessConstructor and Description
public
public
WriteObjectQuery(Object objectToWrite)

public

Method Summary

Modifier and TypeMethod and Description
public void
executeCommit()

INTERNAL: Perform a does exist check to decide whether to perform an insert or update and delegate the work to the mechanism.

public void
executeCommitWithChangeSet()

INTERNAL: Perform a does exist check to decide whether to perform an insert or update and delegate the work to the mechanism.

public Object

Returns:

object - the object being written.
executeDatabaseQuery
()

Implements abstract org.eclipse.persistence.queries.DatabaseQuery.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()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getDefaultRedirector.

INTERNAL: Returns the specific default redirector for this query type.
public boolean
isWriteObjectQuery()

Overrides org.eclipse.persistence.queries.DatabaseQuery.isWriteObjectQuery.

PUBLIC: Return if this is a write object query.
public void
prepareForExecution()

Overrides org.eclipse.persistence.queries.ObjectLevelModifyQuery.prepareForExecution.

INTERNAL: Prepare the receiver for execution in a session.
Inherited from org.eclipse.persistence.queries.ObjectLevelModifyQuery:
checkDescriptorexecuteInUnitOfWorkexecuteInUnitOfWorkObjectLevelModifyQuerygetBackupClonegetObjectgetObjectChangeSetgetPrimaryKeygetReferenceClassgetReferenceClassNameisObjectLevelModifyQueryprepareresetMonitorNamesetBackupClonesetObjectsetObjectChangeSetsetPrimaryKeytoString

Constructor Detail

WriteObjectQueryback to summary
public WriteObjectQuery()
WriteObjectQueryback to summary
public WriteObjectQuery(Object objectToWrite)
WriteObjectQueryback to summary
public WriteObjectQuery(Call call)

Method Detail

executeCommitback to summary
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.

executeCommitWithChangeSetback to summary
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.

executeDatabaseQueryback to summary
public Object executeDatabaseQuery() throws DatabaseException, OptimisticLockException

Implements abstract org.eclipse.persistence.queries.DatabaseQuery.executeDatabaseQuery.

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.

Returns:Object

object - the object being written.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
OptimisticLockException:
- an error has occurred using the optimistic lock feature
getDefaultRedirectorback to summary
protected QueryRedirector getDefaultRedirector()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getDefaultRedirector.

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

Annotations
@Override
isWriteObjectQueryback to summary
public boolean isWriteObjectQuery()

Overrides org.eclipse.persistence.queries.DatabaseQuery.isWriteObjectQuery.

PUBLIC: Return if this is a write object query.

Annotations
@Override
prepareForExecutionback to summary
public void prepareForExecution() throws QueryException

Overrides org.eclipse.persistence.queries.ObjectLevelModifyQuery.prepareForExecution.

INTERNAL: Prepare the receiver for execution in a session.

Annotations
@Override