Class BambooHibernateObjectDao

java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence.BambooHibernateObjectDao
All Implemented Interfaces:
bucket.core.persistence.ObjectDao, BambooObjectDao, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
AclHibernateDao, AgentHibernateDao, ArtifactLinkHibernateDao, CapabilityHibernateSetDao, ElasticImageConfigurationHibernateDao, ElasticInstanceScheduleDaoImpl, InstantMessagingServerHibernateDao, LabelHibernateDao, NotificationHibernateDao, PasswordResetTokenHibernateDao, PlanDependencyHibernateDao

public abstract class BambooHibernateObjectDao extends org.springframework.orm.hibernate5.support.HibernateDaoSupport implements BambooObjectDao
Base hibernate object dao for Bamboo
  • Field Summary

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

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Find all objects of the class provided by getPersistentClass()
    findAllSorted(@Nullable String sortField)
     
    findById(long id)
    Gets the object from its id
    <T> T
    findById(long id, Class<T> persistentClass)
     
    void
    refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
    Update the stat of an object based on the current state of the database.
    void
    remove(com.atlassian.core.bean.EntityObject objectToRemove)
    Remove an object from the database
    void
    replicate(Object objectToReplicate)
     
    void
    save(com.atlassian.core.bean.EntityObject objectToSave)
    Save an object.
    void
    saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
    Save the object without updateModificationData being called.
    protected void
    updateModificationData(com.atlassian.core.bean.EntityObject objectToSave)
    Perform any modifications that need to be done to an object every time it is saved.

    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

    Methods inherited from interface bucket.core.persistence.ObjectDao

    getPersistentClass
  • Constructor Details

    • BambooHibernateObjectDao

      public BambooHibernateObjectDao()
  • Method Details

    • findById

      public BambooObject findById(long id)
      Description copied from interface: BambooObjectDao
      Gets the object from its id
      Specified by:
      findById in interface BambooObjectDao
      Returns:
      A BambooObject. null if not found.
    • findById

      public <T> T findById(long id, Class<T> persistentClass)
    • save

      public void save(com.atlassian.core.bean.EntityObject objectToSave)
      Save an object. The object's last-modified time will be updated, and if the object is searchable it will be indexed.
      Specified by:
      save in interface bucket.core.persistence.ObjectDao
      Parameters:
      objectToSave -
    • updateModificationData

      protected void updateModificationData(com.atlassian.core.bean.EntityObject objectToSave)
      Perform any modifications that need to be done to an object every time it is saved. The default implementation updates the last-modified timestamp, and sets the creation timestamp if it has not yet been set.
      Parameters:
      objectToSave - the object that is about to be saved
    • replicate

      public void replicate(Object objectToReplicate)
      Specified by:
      replicate in interface bucket.core.persistence.ObjectDao
    • saveRaw

      public void saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
      Save the object without updateModificationData being called. Modification/creation time will not be set, but the object will still be indexed if it is searchable.
      Specified by:
      saveRaw in interface bucket.core.persistence.ObjectDao
      Parameters:
      objectToSave - object to save
    • refresh

      public void refresh(com.atlassian.core.bean.EntityObject objectToRefresh)
      Update the stat of an object based on the current state of the database. The object will be modified in place
      Specified by:
      refresh in interface bucket.core.persistence.ObjectDao
      Parameters:
      objectToRefresh - the object to refresh
    • remove

      public void remove(com.atlassian.core.bean.EntityObject objectToRemove)
      Remove an object from the database
      Specified by:
      remove in interface bucket.core.persistence.ObjectDao
      Parameters:
      objectToRemove - the object to remove
    • findAll

      public List findAll()
      Find all objects of the class provided by getPersistentClass()
      Specified by:
      findAll in interface bucket.core.persistence.ObjectDao
      Returns:
      a list of all objects of the appropriate class, or the empty list if no objects are found
    • findAllSorted

      public List findAllSorted(@Nullable @Nullable String sortField)
      Specified by:
      findAllSorted in interface bucket.core.persistence.ObjectDao