Package com.logicaldoc.core.sequence
Interface SequenceDAO
-
- All Superinterfaces:
PersistentObjectDAO<Sequence>
- All Known Implementing Classes:
HibernateSequenceDAO
public interface SequenceDAO extends PersistentObjectDAO<Sequence>
Utility DAO that can manage sequences persisted in the DBImportant: 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
delete(String name, long objectId, long tenantId)
Deletes the sequenceSequence
findByAlternateKey(String name, long objectId, long tenantId)
Finds the sequence by the given alternate keyList<Sequence>
findByName(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
next(String name, long objectId, long tenantId)
Returns the next value of the sequencelong
next(String name, long objectId, long tenantId, long increment)
Returns the next value of the sequence by incrementing by the given incrementvoid
reset(String name, long objectId, long tenantId, long value)
Initializes the sequence value-
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
next
long next(String name, long objectId, long tenantId)
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
long next(String name, long objectId, long tenantId, long increment)
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
void reset(String name, long objectId, long tenantId, long value)
Initializes the sequence value- Parameters:
name
- name of the sequenceobjectId
- The sequence object IDvalue
- The initial valuetenantId
- ID of the owning tenant
-
delete
void delete(String name, long objectId, long tenantId) throws PersistenceException
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
List<Sequence> findByName(String name, long tenantId)
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
Sequence findByAlternateKey(String name, long objectId, long tenantId)
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
long getCurrentValue(String name, long objectId, long tenantId)
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
-
-