Package com.atlassian.bamboo.oid
Class IdGeneratorDaoImpl
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate5.support.HibernateDaoSupport
-
- com.atlassian.bamboo.oid.IdGeneratorDaoImpl
-
- All Implemented Interfaces:
IdGeneratorDao
,org.springframework.beans.factory.InitializingBean
public class IdGeneratorDaoImpl extends org.springframework.orm.hibernate5.support.HibernateDaoSupport implements IdGeneratorDao
-
-
Constructor Summary
Constructors Constructor Description IdGeneratorDaoImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull List<IdGenerator>
findAll()
Get all generators id.@NotNull com.google.common.collect.Range<Long>
nextIdRange(@NotNull BambooEntityType entityType)
Reserve new range of ids for given entityvoid
resetId(@NotNull BambooEntityOid lastOid)
Reset forward next id value in generator for given entity.void
saveNextId(String name, long nextId)
Saves next id value for given name.
-
-
-
Method Detail
-
nextIdRange
@NotNull public @NotNull com.google.common.collect.Range<Long> nextIdRange(@NotNull @NotNull BambooEntityType entityType)
Description copied from interface:IdGeneratorDao
Reserve new range of ids for given entity- Specified by:
nextIdRange
in interfaceIdGeneratorDao
- Parameters:
entityType
- entity type- Returns:
- id range
-
resetId
public void resetId(@NotNull @NotNull BambooEntityOid lastOid)
Description copied from interface:IdGeneratorDao
Reset forward next id value in generator for given entity. Should be called after some external changes that would generate entities without using generator. New value will be set only if it's bigger than old one.- Specified by:
resetId
in interfaceIdGeneratorDao
- Parameters:
lastOid
- current biggest oid; next id generator for it's type will be updated
-
findAll
@NotNull public @NotNull List<IdGenerator> findAll()
Description copied from interface:IdGeneratorDao
Get all generators id. Used for data export. Avoid using for other reasons.- Specified by:
findAll
in interfaceIdGeneratorDao
-
saveNextId
public void saveNextId(String name, long nextId)
Description copied from interface:IdGeneratorDao
Saves next id value for given name. Used during data import. Avoid using for other reasons.- Specified by:
saveNextId
in interfaceIdGeneratorDao
-
-