Package de.xima.fc.dao.impl
Class FormRecordLockDao
java.lang.Object
de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<FormRecordLock,
,Long, IEntityContext> IFormRecordLockDao
,IGenericDao<FormRecordLock>
The default implementation of
IFormRecordLockDao
that can be accessed via DaoProvider
.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Field Summary
Fields inherited from class de.xima.cmn.dao.AbstractDao
entityClass, LOG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
acquireLock
(IEntityContext ec, long formRecordId) Attempts to acquire a lock on theVorgang
with the given ID.getLockDate
(IEntityContext ec, long formRecordId) Checks whether the form record with the given ID is locked, and if so, returns the date when it was locked.boolean
releaseLock
(IEntityContext ec, long formRecordId) Releases the lock that was acquired byIFormRecordLockDao.acquireLock(IEntityContext, long)
.Methods inherited from class de.xima.fc.dao.impl.GenericDao
getEntityRefs, getPostActionHook, getPreActionHook, read
Methods inherited from class de.xima.cmn.dao.AbstractDao
all, bulkDelete, bulkUpdate, cb, checkLockingVersion, cq, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, notifyListener, notifyListener, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
Methods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, getEntityRefs, read
-
Constructor Details
-
FormRecordLockDao
public FormRecordLockDao()Creates a new instance of this DAO. Normally you should use the singleton instance provided byDaoProvider.WORKFLOWTRIGGER_DAO
.
-
-
Method Details
-
acquireLock
Description copied from interface:IFormRecordLockDao
Attempts to acquire a lock on theVorgang
with the given ID. A call to this method must be accompanied by a matching call toreleaseLock
once you are done with the form record.Used for example by workflow processing, to make sure that only one thread is execution a workflow task.- Specified by:
acquireLock
in interfaceIFormRecordLockDao
- Parameters:
ec
- Entity context to use to access the database.formRecordId
- ID of the form record to lock.- Returns:
true
if the form record was locked, orfalse
otherwise. Only when this shouldtrue
should a thread proceed to process the form record.
-
getLockDate
Description copied from interface:IFormRecordLockDao
Checks whether the form record with the given ID is locked, and if so, returns the date when it was locked. This is meant only for preliminary or UI checks -- always useIFormRecordLockDao.acquireLock(IEntityContext, long)
andIFormRecordLockDao.releaseLock(IEntityContext, long)
when you need to actually lock a form record.- Specified by:
getLockDate
in interfaceIFormRecordLockDao
- Parameters:
ec
- Entity context to use to access the database.formRecordId
- ID of the form record to unlock.- Returns:
null
when the form record is not locked. Otherwise, the date when the form record was locked.
-
releaseLock
Description copied from interface:IFormRecordLockDao
Releases the lock that was acquired byIFormRecordLockDao.acquireLock(IEntityContext, long)
.- Specified by:
releaseLock
in interfaceIFormRecordLockDao
- Parameters:
ec
- Entity context to use to access the database.formRecordId
- ID of the form record to unlock.- Returns:
true
if the form record was locked and was released,false
if the form record was not locked.
-