|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.descriptors.FieldsLockingPolicy
org.eclipse.persistence.descriptors.ChangedFieldsLockingPolicy
public class ChangedFieldsLockingPolicy
Purpose: An implementation of the OptimisticLockingPolicy interface. This policy compares only the changed fields in the WHERE clause when doing an update. If any field has been changed, an optimistic locking exception will be thrown. A delete will only compare the primary key.
NOTE: This policy can only be used inside a unit of work.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy |
---|
org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy.LockOnChange |
Field Summary |
---|
Fields inherited from class org.eclipse.persistence.descriptors.FieldsLockingPolicy |
---|
allNonPrimaryKeyFields, descriptor |
Constructor Summary | |
---|---|
ChangedFieldsLockingPolicy()
PUBLIC: Create a new changed fields locking policy. |
Method Summary | |
---|---|
void |
addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
INTERNAL: Values to be included in the locking mechanism are added to the translation row. |
Expression |
buildDeleteExpression(org.eclipse.persistence.internal.helper.DatabaseTable table,
Expression mainExpression,
org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: When given an expression, this method will return a new expression with the optimistic locking values included. |
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getFieldsToCompare(org.eclipse.persistence.internal.helper.DatabaseTable table,
org.eclipse.persistence.internal.sessions.AbstractRecord transRow,
org.eclipse.persistence.internal.sessions.AbstractRecord modifyRow)
INTERNAL: Returns the fields that should be compared in the where clause. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChangedFieldsLockingPolicy()
Method Detail |
---|
public void addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
addLockValuesToTranslationRow
in interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
addLockValuesToTranslationRow
in class FieldsLockingPolicy
public Expression buildDeleteExpression(org.eclipse.persistence.internal.helper.DatabaseTable table, Expression mainExpression, org.eclipse.persistence.internal.sessions.AbstractRecord row)
buildDeleteExpression
in interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
buildDeleteExpression
in class FieldsLockingPolicy
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getFieldsToCompare(org.eclipse.persistence.internal.helper.DatabaseTable table, org.eclipse.persistence.internal.sessions.AbstractRecord transRow, org.eclipse.persistence.internal.sessions.AbstractRecord modifyRow)
getFieldsToCompare
in class FieldsLockingPolicy
|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |