Interface ObjectDaoInternal<T extends com.atlassian.core.bean.EntityObject>

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      @NonNull List<T> findAll()
      Find all objects currently persisted of a particular type.
      @NonNull List<T> findAllSorted​(String sortField)
      Find all objects currently persisted of a particular type and sort results by named property.
      @NonNull List<T> findAllSorted​(String sortField, boolean cacheable, int offset, int maxResultCount)
      Find all objects currently persisted of a particular type and sort results by named property.
      <E> @NonNull PageResponse<E> findByClassIds​(Iterable<Long> ids, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super E> filter)
      Deprecated.
      since 6.10.0.
      @NonNull PageResponse<T> findByClassIdsFiltered​(Iterable<Long> ids, LimitedRequest limitedRequest, Predicate<? super T> filter)
      Find a list of objects from the same persistent class.
      Class<T> getPersistentClass()
      Gets the type of EntityObject this Dao works with.
      void refresh​(com.atlassian.core.bean.EntityObject objectToRefresh)
      Deprecated.
      since 6.10.0.
      void refreshEntity​(T objectToRefresh)
      Refreshes the object again with the fresh data from db.
      void remove​(com.atlassian.core.bean.EntityObject objectToRemove)
      Deprecated.
      since 6.10.0.
      void removeEntity​(T objectToRemove)
      Remove object from persistence.
      void replicate​(Object objectToReplicate)
      Deprecated.
      since 6.10.0.
      void replicateEntity​(T objectToReplicate)
      Replicate the object.
      void save​(com.atlassian.core.bean.EntityObject objectToSave)
      Deprecated.
      since 6.10.0.
      void saveEntity​(T objectToSave)
      Saves the given object to the database.
      void saveRaw​(com.atlassian.core.bean.EntityObject objectToSave)
      Deprecated.
      since 6.10.0.
      void saveRawEntity​(T objectToSave)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 8.6
    • Method Detail

      • removeEntity

        @Transactional
        void removeEntity​(T objectToRemove)
        Remove object from persistence.
      • refresh

        @Deprecated
        @Transactional
        void refresh​(com.atlassian.core.bean.EntityObject objectToRefresh)
        Deprecated.
        since 6.10.0. Use refreshEntity(EntityObject) instead.
        Refreshes the object again with the fresh data from db.
        Specified by:
        refresh in interface ObjectDao
      • refreshEntity

        @Transactional
        void refreshEntity​(T objectToRefresh)
        Refreshes the object again with the fresh data from db.
      • replicate

        @Deprecated
        @Transactional
        void replicate​(Object objectToReplicate)
        Deprecated.
        since 6.10.0. Use replicateEntity(EntityObject) instead.
        Replicate the object. Replication does not generate a new id if the object does not exist in database and it overwrites the database row if the object already exists in database.
        Specified by:
        replicate in interface ObjectDao
      • replicateEntity

        @Transactional
        void replicateEntity​(T objectToReplicate)
        Replicate the object. Replication does not generate a new id if the object does not exist in database and it overwrites the database row if the object already exists in database.
      • findAll

        @NonNull List<T> findAll()
        Find all objects currently persisted of a particular type.
        Specified by:
        findAll in interface ObjectDao
      • findAllSorted

        @NonNull List<T> findAllSorted​(String sortField)
        Find all objects currently persisted of a particular type and sort results by named property.
        Specified by:
        findAllSorted in interface ObjectDao
        Parameters:
        sortField - the name of the property to be sorted on. This should be null if no sorting is required.
      • findAllSorted

        @NonNull List<T> findAllSorted​(String sortField,
                                       boolean cacheable,
                                       int offset,
                                       int maxResultCount)
        Find all objects currently persisted of a particular type and sort results by named property. This version of the method allows more control over the query.
        Specified by:
        findAllSorted in interface ObjectDao
        Parameters:
        sortField - the name of the property to be sorted on. This should be null if no sorting is required.
        cacheable - control whether the results should be cached
        offset - the index of the first result to be returned
        maxResultCount - the maximum number of results required. Use -1 to specify no limit.
      • findByClassIds

        @Deprecated
        <E> @NonNull PageResponse<E> findByClassIds​(Iterable<Long> ids,
                                                    LimitedRequest limitedRequest,
                                                    com.google.common.base.Predicate<? super E> filter)
        Deprecated.
        Find a list of objects from the same persistent class.
        Specified by:
        findByClassIds in interface ObjectDao
        Type Parameters:
        E - the type of entity to return
        Parameters:
        ids - - the ids of the entities to find
        limitedRequest - the pagination request defining the page size to fetch
        filter - a predicate to do in memory filtering of the result set before returning
        Returns:
        a list of objects matching the filters
      • findByClassIdsFiltered

        @NonNull PageResponse<T> findByClassIdsFiltered​(Iterable<Long> ids,
                                                        LimitedRequest limitedRequest,
                                                        Predicate<? super T> filter)
        Find a list of objects from the same persistent class.
        Parameters:
        ids - - the ids of the entities to find
        limitedRequest - the pagination request defining the page size to fetch
        filter - a predicate to do in memory filtering of the result set before returning
        Returns:
        a list of objects matching the filters
      • saveEntity

        @Transactional
        void saveEntity​(T objectToSave)
        Saves the given object to the database.
        Parameters:
        objectToSave - the object to save.
      • getPersistentClass

        @Transactional(readOnly=true,
                       propagation=SUPPORTS)
        Class<T> getPersistentClass()
        Gets the type of EntityObject this Dao works with.
        Specified by:
        getPersistentClass in interface ObjectDao
        Returns:
        the type
      • saveRaw

        @Deprecated
        @Transactional
        void saveRaw​(com.atlassian.core.bean.EntityObject objectToSave)
        Deprecated.
        since 6.10.0. Use saveRawEntity(EntityObject) instead.
        Saves the object without updating modification data.

        If the object is new, this won't set the creation date on the object. If it already exists, then it won't set the date that it was updated.

        Specified by:
        saveRaw in interface ObjectDao
        Parameters:
        objectToSave - the object to save.
      • saveRawEntity

        @Transactional
        @Deprecated(forRemoval=true)
        void saveRawEntity​(T objectToSave)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.6
        Saves the object without updating modification daa.

        If the object is new, this won't set the creation date on the object. If it already exists, then it won't set the date that it was updated.

        Parameters:
        objectToSave - the object to save.