Methods Summary |
---|
public void | checkDescriptor(oracle.toplink.essentials.internal.sessions.AbstractSession session)INTERNAL:
Ensure that the descriptor has been set.
if (getDescriptor() == null) {
if (getObject() == null) {
throw QueryException.objectToModifyNotSpecified(this);
}
//Bug#3947714 Pass the object instead of class in case object is proxy
ClassDescriptor referenceDescriptor = session.getDescriptor(getObject());
if (referenceDescriptor == null) {
throw QueryException.descriptorIsMissing(getObject().getClass(), this);
}
setDescriptor(referenceDescriptor);
}
|
public java.lang.Object | executeInUnitOfWork(oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl unitOfWork, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow)INTERNAL:
All have done is move code from UnitOfWork.internalExecuteQuery
if (unitOfWork.isAfterWriteChangesButBeforeCommit()) {
throw ValidationException.illegalOperationForUnitOfWorkLifecycle(unitOfWork.getLifecycle(), "executeQuery(ObjectLevelModifyQuery)");
}
return executeInUnitOfWorkObjectLevelModifyQuery(unitOfWork, translationRow);
|
protected java.lang.Object | executeInUnitOfWorkObjectLevelModifyQuery(oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl unitOfWork, oracle.toplink.essentials.internal.sessions.AbstractRecord translationRow)INTERNAL:
This code was moved from UnitOfWork.internalExecuteQuery
if (!unitOfWork.getCommitManager().isActive()) {
throw QueryException.invalidQuery(this);
}
if ((getObject() != null) && (unitOfWork.isClassReadOnly(getObject().getClass()))) {
return getObject();
}
// CR#3216 - Apply check to ObjectLevelModifyQuery not just WriteObjectQuery
if (unitOfWork.shouldPerformNoValidation() && unitOfWork.getUnregisteredExistingObjects().containsKey(getObject())) {
//if the object is an unregistered existing object then skip it. This
// Will only be in the collection if validation is turned off
return null;
}
return super.executeInUnitOfWork(unitOfWork, translationRow);
|
public java.lang.Object | getBackupClone()INTERNAL:
Return the backup clone of the object from the unit of work.
// PERF: A backup clone is only required for the old commit,
// So avoid its creation for normal commit.
if ((backupClone == null) && getSession().isUnitOfWork()) {
setBackupClone(((UnitOfWorkImpl)getSession()).getBackupCloneForCommit(getObject()));
}
return backupClone;
|
public java.lang.Object | getObject()PUBLIC:
Return the object required for modification.
return object;
|
public oracle.toplink.essentials.internal.sessions.ObjectChangeSet | getObjectChangeSet()PUBLIC:
Return the ObjectChangeSet representing the object being changed
return this.objectChangeSet;
|
public java.util.Vector | getPrimaryKey()INTERNAL:
Get the primary key for the query
return primaryKey;
|
public java.lang.Class | getReferenceClass()Return the domain class associated with this query.
return getObject().getClass();
|
public java.lang.String | getReferenceClassName()INTERNAL:
Return the reference class for a query
Note: Although the API is designed to avoid classpath dependancies for the MW, since the object
is specified at runtime, this will not be an issue.
return getReferenceClass().getName();
|
public boolean | isObjectLevelModifyQuery()PUBLIC:
Return if this is an object level modify query.
return true;
|
protected void | prepare()INTERNAL:
Prepare the receiver for execution in a session.
In particular check that the tables on the descriptor are set.
checkDescriptor(getSession());
if (getObject() != null) {// Prepare can be called without the object set yet.
setObject(getDescriptor().getObjectBuilder().unwrapObject(getObject(), getSession()));
}
if (getDescriptor().isAggregateDescriptor()) {
throw QueryException.aggregateObjectCannotBeDeletedOrWritten(getDescriptor(), this);
}
super.prepare();
|
public void | prepareForExecution()INTERNAL:
Prepare the receiver for execution in a session.
In particular check that the tables on the descriptor are set.
super.prepareForExecution();
if (getObject() == null) {
throw QueryException.objectToModifyNotSpecified(this);
}
setObject(getDescriptor().getObjectBuilder().unwrapObject(getObject(), getSession()));
if (getPrimaryKey() == null) {
if (getObjectChangeSet() != null) {
setPrimaryKey(getObjectChangeSet().getPrimaryKeys());
} else {
setPrimaryKey(getSession().keyFromObject(getObject()));
}
}
|
public void | setBackupClone(java.lang.Object backupClone)INTERNAL:
Set the backup clone of the object from the unit of work.
this.backupClone = backupClone;
|
public void | setObject(java.lang.Object object)PUBLIC (REQUIRED):
Set the object required for modification.
this.object = object;
|
public void | setObjectChangeSet(oracle.toplink.essentials.internal.sessions.ObjectChangeSet changeSet)INTERNAL:
Set the ObjectChangeSet representing the object to be written
this.objectChangeSet = changeSet;
|
public void | setPrimaryKey(java.util.Vector primaryKey)INTERNAL:
Set the primary key for the query.
this.primaryKey = primaryKey;
|
public java.lang.String | toString()
return Helper.getShortClassName(getClass()) + "(" + String.valueOf(getObject()) + ")";
|