Class DefaultImageDetailsDao

java.lang.Object
com.atlassian.confluence.pages.attachments.DefaultImageDetailsDao
All Implemented Interfaces:
ImageDetailsPrefetchDao, ImageDetailsDao

@ParametersAreNonnullByDefault public class DefaultImageDetailsDao extends Object implements ImageDetailsDao, ImageDetailsPrefetchDao
Stores and retrieves ImageDetails via Hibernate.
  • Constructor Details

    • DefaultImageDetailsDao

      public DefaultImageDetailsDao(org.hibernate.SessionFactory sessionFactory)
  • Method Details

    • getImageDetails

      public ImageDetails getImageDetails(Attachment attachment)
      Description copied from interface: ImageDetailsDao
      Fetch the image details of a specific attachment from the database.
      Specified by:
      getImageDetails in interface ImageDetailsDao
      Parameters:
      attachment - for which the image details will be retrieved
      Returns:
      null if no image details have been stored for this attachment
    • save

      public void save(ImageDetails imageDetails)
      Description copied from interface: ImageDetailsDao
      Save the image details of an attachment.
      Specified by:
      save in interface ImageDetailsDao
      Parameters:
      imageDetails - to save.
    • removeDetailsFor

      public void removeDetailsFor(Attachment attachment)
      Description copied from interface: ImageDetailsDao
      Remove any stored ImageDetails for the given Attachment.
      Specified by:
      removeDetailsFor in interface ImageDetailsDao
    • imageId

      public static long imageId(Attachment attachment)
    • prefetchImageDetails

      @Internal public int prefetchImageDetails(Collection<Attachment> attachments)
      Attempts to efficiently resolve the ImageDetailsDto of each given Attachment. It does this by issuing a query for all ImageDetailsDto entities with IDs that match the IDs of the given attachments.
      Specified by:
      prefetchImageDetails in interface ImageDetailsPrefetchDao
      Returns:
      the number of entities that were prefetched
      Since:
      5.10