Package de.xima.fc.dao.impl
Class MandantRessourceDao
- java.lang.Object
-
- de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
-
- de.xima.fc.dao.impl.GenericDao<E>
-
- de.xima.fc.dao.impl.MandantDependentBaseDao<MandantRessource>
-
- de.xima.fc.dao.impl.MandantRessourceDao
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<MandantRessource,Long,IEntityContext>,IGenericDao<MandantRessource>,IMandantDependentBaseDao<MandantRessource>,IMandantRessourceDao
public class MandantRessourceDao extends MandantDependentBaseDao<MandantRessource> implements IMandantRessourceDao
-
-
Constructor Summary
Constructors Constructor Description MandantRessourceDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MandantRessourcecreate(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant)MandantRessourcecreate(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant)StringfindUniqueName(IEntityContext ec, Mandant client, String candidate, MandantRessource exclude)Returns a name that is not taken by anotherMandantRessourcein the given client.List<MandantRessource>getAllByExtension(IEntityContext ec, Mandant client, Iterable<String> extensions)List<MandantRessource>getAllByMandant(IEntityContext ec, Mandant mandant)List<MandantRessource>getAllByProject(IEntityContext ec, Projekt project)Returns all client resources that are being used by the given projectMandantRessourcegetByName(IEntityContext ec, Mandant mandant, String name)MandantRessourcegetByUUID(IEntityContext ec, Mandant client, String uuid)Returns the client resource for the given UUID string and clientMandantRessourcegetByUUID(IEntityContext ec, Mandant client, UUID uuid)Returns the client resource for the given UUID and clientSet<de.xima.cmn.dao.interfaces.IEntity<Long>>getEntityRefs(IEntityContext ec, MandantRessource resource)protected IFCDaoActionHook<MandantRessource>getPostActionHook()protected IFCDaoActionHook<MandantRessource>getPreActionHook()longgetUsedFileSize(IEntityContext ec, Mandant mandant)booleanisNameExisiting(IEntityContext ec, Mandant client, String name)Returns whether or not the given client resource name exists within the given clientMandantRessourceupdate(IEntityContext ec, byte[] daten, String userName, String fileName, MandantRessource res)-
Methods inherited from class de.xima.fc.dao.impl.GenericDao
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
read
-
Methods inherited from interface de.xima.fc.dao.interfaces.IMandantRessourceDao
getAllByMandant, getByName
-
-
-
-
Method Detail
-
getEntityRefs
public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, MandantRessource resource)
- Specified by:
getEntityRefsin interfaceIGenericDao<MandantRessource>- Overrides:
getEntityRefsin classGenericDao<MandantRessource>
-
getByName
public MandantRessource getByName(IEntityContext ec, Mandant mandant, String name)
- Specified by:
getByNamein interfaceIMandantRessourceDao
-
getByUUID
public MandantRessource getByUUID(IEntityContext ec, Mandant client, String uuid)
Description copied from interface:IMandantRessourceDaoReturns the client resource for the given UUID string and client- Specified by:
getByUUIDin interfaceIMandantRessourceDao- Parameters:
ec-IEntityContextto useclient-Mandantcontext in which to look for resourceuuid-StringUUID string of the resource- Returns:
MandantRessourcefor the given UUID and client
-
getByUUID
public MandantRessource getByUUID(IEntityContext ec, Mandant client, UUID uuid)
Description copied from interface:IMandantRessourceDaoReturns the client resource for the given UUID and client- Specified by:
getByUUIDin interfaceIMandantRessourceDao- Parameters:
ec-IEntityContextto useclient-Mandantcontext in which to look for resourceuuid-UUIDUUID of the resource- Returns:
MandantRessourcefor the given UUID and client
-
findUniqueName
public String findUniqueName(IEntityContext ec, Mandant client, String candidate, MandantRessource exclude)
Description copied from interface:IMandantRessourceDaoReturns a name that is not taken by anotherMandantRessourcein the given client. An index will be added to the candidate if necessary.- Specified by:
findUniqueNamein interfaceIMandantRessourceDao- Parameters:
ec-IEntityContextto be usedclient-Mandantfor which a unique client resource name should be generatedcandidate-Stringclient resource name candiate to be made uniqueexclude-MandantRessourceclient resource to be excluded from the search- Returns:
- unique client resource name in the context of the given client
-
isNameExisiting
public boolean isNameExisiting(IEntityContext ec, Mandant client, String name)
Description copied from interface:IMandantRessourceDaoReturns whether or not the given client resource name exists within the given client- Specified by:
isNameExisitingin interfaceIMandantRessourceDao- Parameters:
ec-IEntityContextto be usedclient-Mandantfor which to check uniquenessname-Stringclient resource name to check- Returns:
- whether or not the given name is unique
-
getAllByMandant
public List<MandantRessource> getAllByMandant(IEntityContext ec, Mandant mandant)
- Specified by:
getAllByMandantin interfaceIMandantRessourceDao
-
getAllByProject
public List<MandantRessource> getAllByProject(IEntityContext ec, Projekt project)
Description copied from interface:IMandantRessourceDaoReturns all client resources that are being used by the given project- Specified by:
getAllByProjectin interfaceIMandantRessourceDao- Parameters:
ec- Current entity context for accessing the database.project- A project where to search.- Returns:
- A list of
client resourcesthat are used by the project's workflow configration.
-
getAllByExtension
public List<MandantRessource> getAllByExtension(IEntityContext ec, Mandant client, Iterable<String> extensions)
- Specified by:
getAllByExtensionin interfaceIMandantRessourceDao- Parameters:
ec- Current entity context for accessing the database.client- Client for which to fetch resources.extensions- Extensions to search for.- Returns:
- All project resources that belong to the given project and have one of the given extensions. When no extension is given, an empty list is returned.
-
getPreActionHook
protected IFCDaoActionHook<MandantRessource> getPreActionHook()
- Overrides:
getPreActionHookin classGenericDao<MandantRessource>
-
getPostActionHook
protected IFCDaoActionHook<MandantRessource> getPostActionHook()
- Overrides:
getPostActionHookin classGenericDao<MandantRessource>
-
create
public MandantRessource create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant)
- Specified by:
createin interfaceIMandantRessourceDao
-
create
public MandantRessource create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant)
- Specified by:
createin interfaceIMandantRessourceDao
-
update
public MandantRessource update(IEntityContext ec, byte[] daten, String userName, String fileName, MandantRessource res)
- Specified by:
updatein interfaceIMandantRessourceDao
-
getUsedFileSize
public long getUsedFileSize(IEntityContext ec, Mandant mandant)
- Specified by:
getUsedFileSizein interfaceIMandantRessourceDao
-
-