Package de.xima.fc.dao.impl
Class AttachmentDao
- java.lang.Object
-
- de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
-
- de.xima.fc.dao.impl.GenericDao<Attachment>
-
- de.xima.fc.dao.impl.AttachmentDao
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<Attachment,Long,IEntityContext>,IAttachmentDao,IGenericDao<Attachment>
public class AttachmentDao extends GenericDao<Attachment> implements IAttachmentDao
-
-
Constructor Summary
Constructors Constructor Description AttachmentDao()
-
Method Summary
-
Methods inherited from class de.xima.fc.dao.impl.GenericDao
getEntityRefs, getPostActionHook, read
-
Methods inherited from class de.xima.cmn.dao.AbstractDao
all, bulkDelete, bulkUpdate, cb, checkLockingVersion, cq, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, notifyListener, notifyListener, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
getAllBy
public List<Attachment> getAllBy(IEntityContext ec, Vorgang vorgang, EAttachmentSource source, String uuid)
- Specified by:
getAllByin interfaceIAttachmentDao
-
getByUUID
public Attachment getByUUID(IEntityContext ec, String uuid, Vorgang v)
- Specified by:
getByUUIDin interfaceIAttachmentDao
-
getByName
public Attachment getByName(IEntityContext ec, Vorgang vorgang, String name)
- Specified by:
getByNamein interfaceIAttachmentDao
-
getByUUID
public Attachment getByUUID(IEntityContext ec, String uuid)
- Specified by:
getByUUIDin interfaceIAttachmentDao
-
getByUUID
public Attachment getByUUID(IEntityContext ec, UUID uuid)
Description copied from interface:IAttachmentDaoReturns the attachment with the given UUID- Specified by:
getByUUIDin interfaceIAttachmentDao- Parameters:
ec-IEntityContextto useuuid-UUIDUUID of the attachment- Returns:
Attachmentfor the given UUID
-
getByRecordAndUser
public PagedResult<Attachment> getByRecordAndUser(IEntityContext ec, UUID formRecordUuid, IUser user, int page, int pageSize)
Description copied from interface:IAttachmentDaoFinds the attachments of the form record given by its UUID if the given user can access the form record.- Specified by:
getByRecordAndUserin interfaceIAttachmentDao- 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.
-
deleteByUser
public void deleteByUser(IEntityContext ec, String username, Attachment... attachments)
- Specified by:
deleteByUserin interfaceIAttachmentDao
-
deleteByUser
public void deleteByUser(IEntityContext ec, String username, boolean force, Attachment... attachments)
- Specified by:
deleteByUserin interfaceIAttachmentDao
-
updateByUser
public Attachment updateByUser(IEntityContext ec, String username, String oldFileName, Attachment attachment)
- Specified by:
updateByUserin interfaceIAttachmentDao
-
createByUser
public Attachment createByUser(IEntityContext ec, String username, Attachment attachment)
- Specified by:
createByUserin interfaceIAttachmentDao
-
getPreActionHook
protected IFCDaoActionHook<Attachment> getPreActionHook()
- Overrides:
getPreActionHookin classGenericDao<Attachment>
-
getUsedFileSize
public long getUsedFileSize(IEntityContext ec, Mandant mandant)
- Specified by:
getUsedFileSizein interfaceIAttachmentDao
-
-