Package de.xima.fc.dao.interfaces
Interface IAttachmentDao
-
- All Superinterfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<Attachment,Long,IEntityContext>,IGenericDao<Attachment>
- All Known Implementing Classes:
AttachmentDao
public interface IAttachmentDao extends IGenericDao<Attachment>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intclearOriginalAttachmentReferences(IEntityContext ec, Attachment... attachments)Finds and resets 'original attachment' references to the provided attachments.AttachmentcreateByUser(IEntityContext ec, String username, Attachment attachment)AttachmentcreateByUser(IEntityContext ec, String username, Attachment attachment, List<ProtocolEntryProcessing> protocolEntries)voiddeleteByUser(IEntityContext ec, String username, boolean force, Attachment... attachments)voiddeleteByUser(IEntityContext ec, String username, Attachment... attachments)voiddeleteByUuid(IEntityContext ec, String uuid, Vorgang formRecord)Deletes the attachment of the given form record with the given UUIDList<Attachment>getAllBy(IEntityContext ec, Vorgang vorgang, EAttachmentSource source, String uuid)AttachmentgetByName(IEntityContext ec, Vorgang vorgang, String name)PagedResult<Attachment>getByRecordAndUser(IEntityContext ec, UUID formRecordUuid, IUser user, int page, int pageSize)Finds the attachments of the form record given by its UUID if the given user can access the form record and the attachments itself.AttachmentgetByUUID(IEntityContext ec, String uuid)AttachmentgetByUUID(IEntityContext ec, String uuid, Vorgang v)AttachmentgetByUUID(IEntityContext ec, UUID uuid)Returns the attachment with the given UUIDlonggetUsedFileSize(IEntityContext ec, Mandant mandant)AttachmentupdateByUser(IEntityContext ec, String username, String oldFileName, Attachment attachment)AttachmentupdateByUser(IEntityContext ec, String username, String oldFileName, Attachment attachment, List<ProtocolEntryProcessing> protocolEntries)-
Methods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, getEntityRefs, read
-
-
-
-
Method Detail
-
deleteByUuid
void deleteByUuid(IEntityContext ec, String uuid, Vorgang formRecord)
Deletes the attachment of the given form record with the given UUID- Parameters:
ec- Entity context for database operations.uuid- UUID of the attachment to deleteformRecord- Form record to delete the attachment from.- Since:
- 8.2.0
-
getByName
Attachment getByName(IEntityContext ec, Vorgang vorgang, String name)
-
getAllBy
List<Attachment> getAllBy(IEntityContext ec, Vorgang vorgang, EAttachmentSource source, String uuid)
-
getByUUID
Attachment getByUUID(IEntityContext ec, String uuid, Vorgang v)
-
getByUUID
Attachment getByUUID(IEntityContext ec, String uuid)
-
getByUUID
Attachment getByUUID(IEntityContext ec, UUID uuid)
Returns the attachment with the given UUID- Parameters:
ec-IEntityContextto useuuid-UUIDUUID of the attachment- Returns:
Attachmentfor the given UUID- Since:
- 6.1.0
-
getUsedFileSize
long getUsedFileSize(IEntityContext ec, Mandant mandant)
-
deleteByUser
void deleteByUser(IEntityContext ec, String username, Attachment... attachments)
-
deleteByUser
void deleteByUser(IEntityContext ec, String username, boolean force, Attachment... attachments)
-
updateByUser
Attachment updateByUser(IEntityContext ec, String username, String oldFileName, Attachment attachment)
-
createByUser
Attachment createByUser(IEntityContext ec, String username, Attachment attachment)
-
updateByUser
Attachment updateByUser(IEntityContext ec, String username, String oldFileName, Attachment attachment, List<ProtocolEntryProcessing> protocolEntries)
- Parameters:
ec- the entity context to useusername- the name of the involved useroldFileName- the name of the file to be replaced (just for the protocol)attachment- the attachment to updateprotocolEntries- (modifiable) list of protocol entries- note: general protocol entry properties as 'benutzer' will be set here in the DAO
- note: a concluding 'attachment updated' protocol entry for this update will also be added here
- Returns:
- the updated attachment
-
createByUser
Attachment createByUser(IEntityContext ec, String username, Attachment attachment, List<ProtocolEntryProcessing> protocolEntries)
- Parameters:
ec- the entity context to useusername- the name of the involved userattachment- the attachment to persistprotocolEntries- (modifiable) list of protocol entries- note: general protocol entry properties as 'benutzer' will be set here in the DAO
- note: a concluding 'attachment created' protocol entry for this update will also be added here
- Returns:
- the persisted attachment
-
getByRecordAndUser
PagedResult<Attachment> getByRecordAndUser(IEntityContext ec, UUID formRecordUuid, IUser user, int page, int pageSize)
Finds the attachments of the form record given by its UUID if the given user can access the form record and the attachments itself.- Parameters:
ec- entity context for accessing the database.formRecordUuid- the UUID of the form recorduser- to get the attachments for.page- to get. If a page less than or equal tozerois given, paging is disabled and all entities are returned in one page.pageSize- size of the page to get. If a page size less thanzerois given, paging is disabled and all entities are returned in one page.- Returns:
- a list of form record attachment of the form record the user has access to ordered by their upload date
(desc).
nullif the form record given by the UUID could not be found. - Since:
- 8.2.0
-
clearOriginalAttachmentReferences
int clearOriginalAttachmentReferences(IEntityContext ec, Attachment... attachments)
Finds and resets 'original attachment' references to the provided attachments.- Parameters:
ec- entity context for accessing the database.attachments- attachments which might be referenced from other attachments as their 'original attachment'- Returns:
- number of cleared references
-
-