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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetImageDetails
(Attachment attachment) Fetch the image details of a specific attachment from the database.static long
imageId
(Attachment attachment) int
prefetchImageDetails
(Collection<Attachment> attachments) Attempts to efficiently resolve theImageDetailsDto
of each givenAttachment
.void
removeDetailsFor
(Attachment attachment) Remove any storedImageDetails
for the givenAttachment
.void
save
(ImageDetails imageDetails) Save the image details of an attachment.
-
Constructor Details
-
DefaultImageDetailsDao
public DefaultImageDetailsDao(org.hibernate.SessionFactory sessionFactory)
-
-
Method Details
-
getImageDetails
Description copied from interface:ImageDetailsDao
Fetch the image details of a specific attachment from the database.- Specified by:
getImageDetails
in interfaceImageDetailsDao
- Parameters:
attachment
- for which the image details will be retrieved- Returns:
- null if no image details have been stored for this attachment
-
save
Description copied from interface:ImageDetailsDao
Save the image details of an attachment.- Specified by:
save
in interfaceImageDetailsDao
- Parameters:
imageDetails
- to save.
-
removeDetailsFor
Description copied from interface:ImageDetailsDao
Remove any storedImageDetails
for the givenAttachment
.- Specified by:
removeDetailsFor
in interfaceImageDetailsDao
-
imageId
-
prefetchImageDetails
Attempts to efficiently resolve theImageDetailsDto
of each givenAttachment
. It does this by issuing a query for allImageDetailsDto
entities with IDs that match the IDs of the given attachments.- Specified by:
prefetchImageDetails
in interfaceImageDetailsPrefetchDao
- Returns:
- the number of entities that were prefetched
- Since:
- 5.10
-