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 retrievesImageDetails
via 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 ImageDetails
getImageDetails(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.
-
-
-
Method Detail
-
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 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:ImageDetailsDao
Save the image details of an attachment.- Specified by:
save
in interfaceImageDetailsDao
- Parameters:
imageDetails
- to save.
-
removeDetailsFor
public void removeDetailsFor(Attachment attachment)
Description copied from interface:ImageDetailsDao
Remove any storedImageDetails
for the givenAttachment
.- Specified by:
removeDetailsFor
in interfaceImageDetailsDao
-
imageId
public static long imageId(Attachment attachment)
-
prefetchImageDetails
@Internal public int prefetchImageDetails(Collection<Attachment> attachments)
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
-
-