Package com.logicaldoc.core.sequence
Interface SequenceDAO
- All Superinterfaces:
PersistentObjectDAO<Sequence>
- All Known Implementing Classes:
HibernateSequenceDAO
Utility DAO that can manage sequences persisted in the DB
Important: Implementations of this interface must grant synchronization.
- Since:
- 4.0
- Author:
- Matteo Caruso - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes the sequencefindByAlternateKey
(String name, long objectId, long tenantId) Finds the sequence by the given alternate keyfindByName
(String name, long tenantId) Finds all sequences whose name starts with the passed namelong
getCurrentValue
(String name, long objectId, long tenantId) Gets the current valuelong
Returns the next value of the sequencelong
Returns the next value of the sequence by incrementing by the given incrementvoid
Initializes the sequence valueMethods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString, store
-
Method Details
-
next
Returns the next value of the sequence- Parameters:
name
- name of the sequenceobjectId
- The sequence object IDtenantId
- ID of the owning tenant- Returns:
- The next value
-
next
Returns the next value of the sequence by incrementing by the given increment- Parameters:
name
- name of the sequenceobjectId
- The sequence object IDtenantId
- ID of the owning tenantincrement
- ID of the owning tenant- Returns:
- The next value
-
reset
Initializes the sequence value- Parameters:
name
- name of the sequenceobjectId
- The sequence object IDtenantId
- ID of the owning tenantvalue
- The initial value
-
delete
Deletes the sequence- Parameters:
name
- name of the sequenceobjectId
- value for the objectId fieldtenantId
- identifier of the tenant- Throws:
PersistenceException
- if a database error occurs
-
findByName
Finds all sequences whose name starts with the passed name- Parameters:
name
- name of the sequencetenantId
- identifier of the tenant- Returns:
- collection of sequences
-
findByAlternateKey
Finds the sequence by the given alternate key- Parameters:
name
- name of the sequenceobjectId
- value for the objectId fieldtenantId
- identifier of the tenant- Returns:
- the sequence object
-
getCurrentValue
Gets the current value- Parameters:
name
- name of the sequenceobjectId
- value for the objectId fieldtenantId
- identifier of the tenant- Returns:
- current value of the sequence
-