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
  • Field Summary

    Fields inherited from class org.springframework.dao.support.DaoSupport

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull List<IdGenerator>
    Get all generators id.
    @NotNull com.google.common.collect.Range<Long>
    nextIdRange(@NotNull BambooEntityType entityType)
    Reserve new range of ids for given entity
    void
    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.

    Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport

    checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory

    Methods inherited from class org.springframework.dao.support.DaoSupport

    afterPropertiesSet, initDao

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IdGeneratorDaoImpl

      public IdGeneratorDaoImpl()
  • Method Details

    • 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 interface IdGeneratorDao
      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 interface IdGeneratorDao
      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 interface IdGeneratorDao
    • 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 interface IdGeneratorDao