1 21 package oracle.toplink.essentials.internal.descriptors; 23 24 import java.io.Serializable ; 25 import java.util.Vector ; 26 import oracle.toplink.essentials.expressions.*; 27 import oracle.toplink.essentials.internal.helper.DatabaseField; 28 import oracle.toplink.essentials.internal.sessions.ObjectChangeSet; 29 import oracle.toplink.essentials.queryframework.*; 30 import oracle.toplink.essentials.internal.sessions.AbstractRecord; 31 import oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl; 32 import oracle.toplink.essentials.internal.sessions.AbstractSession; 33 import oracle.toplink.essentials.descriptors.ClassDescriptor; 34 35 public interface OptimisticLockingPolicy extends Cloneable , Serializable { 36 37 44 public void addLockFieldsToUpdateRow(AbstractRecord databaseRow, AbstractSession session); 45 46 53 public void addLockValuesToTranslationRow(ObjectLevelModifyQuery query); 54 55 63 public Expression buildDeleteExpression(oracle.toplink.essentials.internal.helper.DatabaseTable table, Expression mainExpression, AbstractRecord row); 64 65 73 public Expression buildUpdateExpression(oracle.toplink.essentials.internal.helper.DatabaseTable table, Expression mainExpression, AbstractRecord translationRow, AbstractRecord modifyRow); 74 75 public Object clone(); 76 77 89 public int compareWriteLockValues(Object value1, Object value2); 90 91 96 abstract public Object getBaseValue(); 97 98 105 public Object getValueToPutInCache(AbstractRecord row, AbstractSession session); 106 107 111 public int getVersionDifference(Object currentValue, Object domainObject, Vector primaryKeys, AbstractSession session); 112 113 119 public DatabaseField getWriteLockField(); 120 121 127 public Object getWriteLockValue(Object domainObject, java.util.Vector primaryKey, AbstractSession session); 128 129 136 public Expression getWriteLockUpdateExpression(ExpressionBuilder builder); 137 138 144 public void initialize(AbstractSession session); 145 146 152 public void initializeProperties(); 153 154 158 public boolean isChildWriteLockValueGreater(AbstractSession session, java.util.Vector primaryKey, Class original, ObjectChangeSet changeSet); 159 160 164 public boolean isChildWriteLockValueGreater(UnitOfWorkImpl uow, java.util.Vector primaryKey, Class original); 165 166 173 public boolean isNewerVersion(Object currentValue, Object domainObject, java.util.Vector primaryKey, AbstractSession session); 174 175 184 public boolean isNewerVersion(AbstractRecord databaseRow, Object domainObject, java.util.Vector primaryKey, AbstractSession session); 185 186 192 public void mergeIntoParentCache(UnitOfWorkImpl uow, java.util.Vector primaryKey, Object object); 193 194 198 public void setDescriptor(ClassDescriptor descriptor); 199 200 208 public void setupWriteFieldsForInsert(ObjectLevelModifyQuery query); 209 210 217 public void updateRowAndObjectForUpdate(ObjectLevelModifyQuery query, Object object); 218 219 public void validateDelete(int rowCount, Object object, DeleteObjectQuery query); 220 221 public void validateUpdate(int rowCount, Object object, WriteObjectQuery query); 222 223 227 public void prepareFetchGroupForReadQuery(FetchGroup fetchGroup, ObjectLevelReadQuery query); 228 } 229 | Popular Tags |