|
EclipseLink 2.0.0, build 'v20091127-r5931' 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.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.Vector |
lockFields
|
protected java.util.Map |
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 fieldname 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.Vector |
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.Vector |
getLockFields()
INTERNAL: Returns the lock fields |
protected java.util.Vector |
getLockFields(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: returns the lock fields based on the passed in table |
protected java.util.Map |
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.Vector lockFieldNames)
PUBLIC: Set the field names to lock on. |
void |
setLockFields(java.util.Map lockFieldsByTable)
INTERNAL: Used to set the field names to be used in this policy. |
protected void |
setLockFields(java.util.Vector lockFields)
INTERNAL: Sets the lock fields |
protected void |
setLockFieldsByTable(java.util.Map 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 lockFieldsByTable
protected java.util.Vector 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.Vector 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.Vector getLockFields()
protected java.util.Vector getLockFields(org.eclipse.persistence.internal.helper.DatabaseTable table)
protected java.util.Map 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.Vector lockFieldNames)
public void setLockFields(java.util.Map lockFieldsByTable)
protected void setLockFields(java.util.Vector lockFields)
protected void setLockFieldsByTable(java.util.Map lockFieldsByTable)
|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |