|
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.Object org.eclipse.persistence.descriptors.FieldsLockingPolicy org.eclipse.persistence.descriptors.SelectedFieldsLockingPolicy
public class SelectedFieldsLockingPolicy
Purpose: An implementation of the OptimisticLockingPolicy interface. This policy compares selected fields in the WHERE clause when doing an update or a delete. If any field has been changed, an optimistic locking exception will be thrown. Note that the fields specified must be mapped and not be primary keys.
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 | |
---|---|
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
lockFields
|
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> |
lockFieldsByTable
|
Fields inherited from class org.eclipse.persistence.descriptors.FieldsLockingPolicy |
---|
allNonPrimaryKeyFields, descriptor |
Constructor Summary | |
---|---|
SelectedFieldsLockingPolicy()
PUBLIC: Create a new selected fields locking policy. |
Method Summary | |
---|---|
void |
addLockFieldName(java.lang.String fieldName)
PUBLIC: Add a field name to lock on. |
void |
addLockValuesToTranslationRow(ObjectLevelModifyQuery query)
INTERNAL: Values to be included in the locking mechanism are added to the translation row. |
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 lock fields to compare based on the passed in table. |
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getLockFields()
INTERNAL: Returns the lock fields |
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getLockFields(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: returns the lock fields based on the passed in table |
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> |
getLockFieldsByTable()
INTERNAL: returns the lock fields |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: It is responsible for initializing the policy; |
void |
setLockFieldNames(java.util.List<java.lang.String> lockFieldNames)
PUBLIC: Set the field names to lock on. |
protected void |
setLockFields(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> lockFields)
INTERNAL: Sets the lock fields |
protected void |
setLockFieldsByTable(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> lockFieldsByTable)
INTERNAL: Used to set the field names to be used in this policy. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> lockFieldsByTable
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> lockFields
Constructor Detail |
---|
public SelectedFieldsLockingPolicy()
Method Detail |
---|
public void addLockFieldName(java.lang.String fieldName)
public void addLockValuesToTranslationRow(ObjectLevelModifyQuery query) throws DatabaseException
addLockValuesToTranslationRow
in interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
addLockValuesToTranslationRow
in class FieldsLockingPolicy
DatabaseException
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
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getLockFields()
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getLockFields(org.eclipse.persistence.internal.helper.DatabaseTable table)
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> getLockFieldsByTable()
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
initialize
in interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
initialize
in class FieldsLockingPolicy
public void setLockFieldNames(java.util.List<java.lang.String> lockFieldNames)
protected void setLockFields(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> lockFields)
protected void setLockFieldsByTable(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseTable,java.util.List<org.eclipse.persistence.internal.helper.DatabaseField>> lockFieldsByTable)
|
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 |