- All Implemented Interfaces:
Serializable,Comparable<DbTokenLock>,ModificationLoggable,org.tentackle.misc.Identifiable,org.tentackle.misc.Immutable,org.tentackle.misc.SerialNumbered,TokenLock,org.tentackle.session.SessionDependable,org.tentackle.session.SessionProvider
@ClassId(10)
@TableName("tokenlock")
public class DbTokenLock
extends AbstractDbObject<DbTokenLock>
implements TokenLock
Table holding the token locks.
A TokenLock is an add-on to the editedBy/Since/Expiry-token in PDOs.
TokenLocks are maintained by the LockManager.
The ID of the TokenLock is the same as the PDO being locked.
The serial is not related to the PDO, starts at 1 and is incremented whenever lockedBy,
lockedSince or lockExpiry changes.
Notice the [NOPKEY] to suppress the generation of the default primary key on id.
Instead the index is unique on (id, pdoclassid). Thus, it is still allowed that
objects of different classes share the same id.
Notice, that this table is only used in servers, never in remote clients or simple 2-tier applications.
- Author:
- harald
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DbObjectClassVariables<DbTokenLock>Variables common to all instances ofDbTokenLock.static final Stringdatabase column name for 'lockedBy'.static final Stringdatabase column name for 'lockedSince'.static final Stringdatabase column name for 'lockExpiry'.static final Stringdatabase column name for 'pdoClassId'.Fields inherited from class org.tentackle.dbms.AbstractDbObject
AN_CLASSID, AN_ID, AN_SERIAL, AN_TABLESERIAL, CN_CLASSID, CN_ID, CN_SERIAL, CN_TABLESERIAL, TX_DELETE_LIST, TX_DELETE_MISSING_IN_LIST, TX_DELETE_OBJECT, TX_DUMMY_UPDATE, TX_INSERT_OBJECT, TX_INSERT_PLAIN, TX_SAVE, TX_SAVE_LIST, TX_SYNC, TX_UPDATE_OBJECT, TX_UPDATE_PLAIN, TX_UPDATE_SERIAL, TX_UPDATE_SERIAL_AND_TABLESERIAL, TX_UPDATE_TABLESERIAL -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty modification object.DbTokenLock(Db db) Creates an empty modification object. -
Method Summary
Modifier and TypeMethodDescriptionvoidlongGets the attribute lockedBy.org.tentackle.common.TimestampGets the attribute lockedSince.org.tentackle.common.TimestampGets the attribute lockExpiry.intGets the attribute pdoClassId.longgetPdoId()Gets the object id of locked PDO.intvoidsetLockedBy(long lockedBy) Sets the attribute lockedBy.voidsetLockedSince(org.tentackle.common.Timestamp lockedSince) Sets the attribute lockedSince.voidsetLockExpiry(org.tentackle.common.Timestamp lockExpiry) Sets the attribute lockExpiry.voidsetPdoClassId(int pdoClassId) Sets the attribute pdoClassId.Methods inherited from class org.tentackle.dbms.AbstractDbObject
acceptPersistenceVisitor, addPropertyListener, addPropertyListener, alignComponents, assertMutable, assertNew, assertNotNew, assertNotOverloaded, assertNotRemote, assertNumberOfRowsAffected, assertPersistable, assertRemote, assertThisRowAffected, attributesModified, clearOnRemoteSave, compareTo, countModification, createAttributesInSnapshot, createDeleteAllSql, createDeleteSql, createDummyUpdateSql, createPreparedStatement, createPreparedStatement, createPropertySupport, createSelectAllByIdInnerSql, createSelectAllIdSerialInnerSql, createSelectAllInnerSql, createSelectExpiredTableSerials1Sql, createSelectExpiredTableSerials2Sql, createSelectIdInnerSql, createSelectMaxIdSql, createSelectMaxTableSerialSql, createSelectObjectsWithExpiredTableSerialsSql, createSelectSerialSql, createSelectSql, createSqlUpdate, createUpdateAndSetSerialSql, createUpdateSerialAndTableSerialSql, createUpdateSerialSql, deleteImpl, deleteObject, deletePlain, deleteReferencedRelations, deleteReferencingRelations, differsPersisted, dummyUpdate, equals, finishModification, finishNotUpdated, firePropertyChange, getBackend, getClassBaseName, getClassId, getColumnCount, getExpirationBacklog, getExpiredTableSerials, getId, getIdSource, getImmutableLoggingLevel, getModificationCount, getModificationLog, getPreparedStatement, getPreparedStatement, getPropertySupport, getRemoteDelegate, getSerial, getSession, getSessionHolder, getTableName, getTableSerial, hashCode, initModification, insertImpl, insertObject, insertPlain, isCopy, isCountingModification, isDeleted, isEntity, isFinallyImmutable, isForcedModified, isFromThisJVM, isIdValid, isImmutable, isLoggingModification, isModified, isNew, isOverloadable, isPersistable, isReferenced, isRemovable, isSessionImmutable, isStatementAlwaysPrepared, isTableSerialProvided, isTracked, isUpdateNecessary, isUpdatingSerialEvenIfNotModified, isVirgin, loadLazyReferences, logModification, markDeleted, newId, newInstance, newInstance, newInstance, persistObject, prepareDelete, prepareSave, prepareSetFields, readFromResultSetWrapper, reloadObject, reloadObjectForUpdate, removeAllPropertyListeners, removePropertyListener, removePropertyListener, reserveId, reserveId, resultAllIdSerial, resultAllObjects, resultObjectsWithExpiredTableSerials, revertAttributesToSnapshot, saveObject, saveReferencedRelations, saveReferencingRelations, selectAllIdSerial, selectAllObjects, selectExpiredTableSerials, selectExpiredTableSerials, selectMaxId, selectMaxTableSerial, selectNextObject, selectObject, selectObjectForUpdate, selectObjectsWithExpiredTableSerials, selectSerial, setClassId, setFinallyImmutable, setId, setImmutable, setImmutableLoggingLevel, setModificationLog, setModified, setOverloadable, setSerial, setSession, setSessionHolder, setSessionImmutable, setStatementAlwaysPrepared, setTableSerial, toGenericString, toIdString, toString, unmarkDeleted, updateImpl, updateObject, updatePlain, updateSerial, updateSerial, updateSerialAndTableSerialMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tentackle.dbms.ModificationLoggable
createModificationLog
-
Field Details
-
CLASSVARIABLES
Variables common to all instances ofDbTokenLock. -
CN_PDOCLASSID
database column name for 'pdoClassId'.- See Also:
-
CN_LOCKEDBY
database column name for 'lockedBy'.- See Also:
-
CN_LOCKEDSINCE
database column name for 'lockedSince'.- See Also:
-
CN_LOCKEXPIRY
database column name for 'lockExpiry'.- See Also:
-
-
Constructor Details
-
DbTokenLock
Creates an empty modification object.- Parameters:
db- the database connection
-
DbTokenLock
public DbTokenLock()Creates an empty modification object.
-
-
Method Details
-
getClassVariables
- Overrides:
getClassVariablesin classAbstractDbObject<DbTokenLock>
-
getFields
- Overrides:
getFieldsin classAbstractDbObject<DbTokenLock>
-
setFields
- Overrides:
setFieldsin classAbstractDbObject<DbTokenLock>
-
createInsertSql
- Overrides:
createInsertSqlin classAbstractDbObject<DbTokenLock>
-
createUpdateSql
- Overrides:
createUpdateSqlin classAbstractDbObject<DbTokenLock>
-
getPdoClassId
public int getPdoClassId()Gets the attribute pdoClassId.- Specified by:
getPdoClassIdin interfaceTokenLock- Returns:
- class ID of the PDO
-
setPdoClassId
public void setPdoClassId(int pdoClassId) Sets the attribute pdoClassId.- Parameters:
pdoClassId- class ID of the PDO
-
getLockedBy
public long getLockedBy()Gets the attribute lockedBy.- Specified by:
getLockedByin interfaceTokenLock- Returns:
- userId of token lock holder
-
setLockedBy
public void setLockedBy(long lockedBy) Sets the attribute lockedBy.- Parameters:
lockedBy- userId of token lock holder
-
getLockedSince
public org.tentackle.common.Timestamp getLockedSince()Gets the attribute lockedSince.- Specified by:
getLockedSincein interfaceTokenLock- Returns:
- time since token lock given to user
-
setLockedSince
public void setLockedSince(org.tentackle.common.Timestamp lockedSince) Sets the attribute lockedSince.- Parameters:
lockedSince- time since token lock given to user
-
getLockExpiry
public org.tentackle.common.Timestamp getLockExpiry()Gets the attribute lockExpiry.- Specified by:
getLockExpiryin interfaceTokenLock- Returns:
- time when token lock expires
-
setLockExpiry
public void setLockExpiry(org.tentackle.common.Timestamp lockExpiry) Sets the attribute lockExpiry.- Parameters:
lockExpiry- time when token lock expires
-
getPdoId
public long getPdoId()Description copied from interface:TokenLockGets the object id of locked PDO.
-