Class VersionedHibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>

    • Field Detail

      • cacheFactory

        protected com.atlassian.cache.CacheFactory cacheFactory
    • Constructor Detail

      • VersionedHibernateObjectDao

        public VersionedHibernateObjectDao()
    • Method Detail

      • findLatestVersionsIterator

        protected Iterator<T> findLatestVersionsIterator​(String... statuses)
      • findLatestVersionsCount

        public long findLatestVersionsCount()
        Description copied from interface: VersionedObjectDao
        Returns the number of results for the latest versions of the current persistent class.
        Specified by:
        findLatestVersionsCount in interface VersionedObjectDao<T extends com.atlassian.core.bean.EntityObject>
        Returns:
        a long representing the number of results
      • findLatestVersionsCount

        protected long findLatestVersionsCount​(String... statuses)
      • findAllSorted

        public @NonNull List<T> findAllSorted​(String sortField)
        Description copied from interface: ObjectDaoInternal
        Find all objects currently persisted of a particular type and sort results by named property.
        Specified by:
        findAllSorted in interface ObjectDao
        Specified by:
        findAllSorted in interface ObjectDaoInternal<T extends com.atlassian.core.bean.EntityObject>
        Overrides:
        findAllSorted in class HibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>
        Parameters:
        sortField - the name of the property to be sorted on. This should be null if no sorting is required.
      • saveEntity

        public void saveEntity​(T objectToSave,
                               @Nullable T previousVersion)
        Description copied from interface: VersionedObjectDaoInternal
        Saves the given current object and historical object.
        Specified by:
        saveEntity in interface VersionedObjectDaoInternal<T extends com.atlassian.core.bean.EntityObject>
        Parameters:
        objectToSave - the current object.
        previousVersion - the original object. This will be mutated to become a historical version as part of this save.
      • save

        @Deprecated
        public void save​(com.atlassian.core.bean.EntityObject objectToSave,
                         com.atlassian.core.bean.EntityObject previousVersion)
        Deprecated.
        since 6.10.0. Use saveEntity(EntityObject, EntityObject) instead.
        Description copied from interface: VersionedObjectDao
        Saves the given current object and historical object
        Specified by:
        save in interface VersionedObjectDao<T extends com.atlassian.core.bean.EntityObject>
        Parameters:
        objectToSave - the current object.
        previousVersion - the original object. This will be mutated to become a historical version as part of this save.
      • updateModificationData

        protected void updateModificationData​(com.atlassian.core.bean.EntityObject objectToSave)
        Description copied from class: HibernateObjectDao
        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.
        Overrides:
        updateModificationData in class HibernateObjectDao<T extends com.atlassian.core.bean.EntityObject>
        Parameters:
        objectToSave - the object that is about to be saved
      • setCacheFactory

        @Deprecated
        public void setCacheFactory​(com.atlassian.cache.CacheFactory cacheFactory)
        Deprecated.
        since 5.10. Subclasses should implement this themselves.
      • setConfluenceUserDao

        @Deprecated
        public void setConfluenceUserDao​(ConfluenceUserDao confluenceUserDao)
        Deprecated.
        since 5.10. Subclasses should implement this themselves.