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 retrievesImageDetailsvia Hibernate.
-
-
Constructor Summary
Constructors Constructor Description DefaultImageDetailsDao(org.hibernate.SessionFactory sessionFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImageDetailsgetImageDetails(Attachment attachment)Fetch the image details of a specific attachment from the database.static longimageId(Attachment attachment)intprefetchImageDetails(Collection<Attachment> attachments)Attempts to efficiently resolve theImageDetailsDtoof each givenAttachment.voidremoveDetailsFor(Attachment attachment)Remove any storedImageDetailsfor the givenAttachment.voidsave(ImageDetails imageDetails)Save the image details of an attachment.
-
-
-
Method Detail
-
getImageDetails
public ImageDetails getImageDetails(Attachment attachment)
Description copied from interface:ImageDetailsDaoFetch the image details of a specific attachment from the database.- Specified by:
getImageDetailsin interfaceImageDetailsDao- 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:ImageDetailsDaoSave the image details of an attachment.- Specified by:
savein interfaceImageDetailsDao- Parameters:
imageDetails- to save.
-
removeDetailsFor
public void removeDetailsFor(Attachment attachment)
Description copied from interface:ImageDetailsDaoRemove any storedImageDetailsfor the givenAttachment.- Specified by:
removeDetailsForin interfaceImageDetailsDao
-
imageId
public static long imageId(Attachment attachment)
-
prefetchImageDetails
@Internal public int prefetchImageDetails(Collection<Attachment> attachments)
Attempts to efficiently resolve theImageDetailsDtoof each givenAttachment. It does this by issuing a query for allImageDetailsDtoentities with IDs that match the IDs of the given attachments.- Specified by:
prefetchImageDetailsin interfaceImageDetailsPrefetchDao- Returns:
- the number of entities that were prefetched
- Since:
- 5.10
-
-