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
The default implementation of
IMandantRessourceDao that can be accessed via DaoProvider.- Author:
- XIMA MEDIA GmbH
-
Field Summary
Fields inherited from class de.xima.cmn.dao.AbstractDao
entityClass, LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant) create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant) findUniqueName(IEntityContext ec, Mandant client, String candidate, MandantRessource exclude) Returns a name that is not taken by anotherMandantRessourcein the given client.getAllByExtension(IEntityContext ec, Mandant client, Iterable<String> extensions) getAllByMandant(IEntityContext ec, Mandant mandant) getAllByProject(IEntityContext ec, Projekt project) Deprecated.getByName(IEntityContext ec, Mandant mandant, String name) getByUUID(IEntityContext ec, Mandant client, String uuid) Returns the client resource for the given UUID string and clientgetByUUID(IEntityContext ec, Mandant client, UUID uuid) Returns the client resource for the given UUID and clientgetEntityRefs(IEntityContext ec, MandantRessource resource) Returns a set of entities that reference the given entity and depend on it.protected IFCDaoActionHook<MandantRessource>protected IFCDaoActionHook<MandantRessource>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 clientupdate(IEntityContext ec, byte[] daten, String userName, String fileName, MandantRessource res) Methods inherited from class de.xima.fc.dao.impl.GenericDao
readMethods 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, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, updateMethods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, readMethods inherited from interface de.xima.fc.dao.interfaces.IMandantRessourceDao
getAllByMandant, getByName
-
Constructor Details
-
MandantRessourceDao
public MandantRessourceDao()Creates a new instance of this DAO. Normally you should use the singleton instance provided byDaoProvider.MANDANTRESSOURCE_DAO.
-
-
Method Details
-
getEntityRefs
public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, MandantRessource resource) Description copied from interface:IGenericDaoReturns a set of entities that reference the given entity and depend on it. An entity can usually not be deleted if it is still being referenced by and depended on by other entities.- Specified by:
getEntityRefsin interfaceIGenericDao<MandantRessource>- Overrides:
getEntityRefsin classGenericDao<MandantRessource>- Parameters:
ec- entity context for database transactions.resource- to get references for.- Returns:
- a set of entities that reference the given entity and depend on it.
-
getByName
- Specified by:
getByNamein interfaceIMandantRessourceDao
-
getByUUID
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
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 candidate to be made uniqueexclude-MandantRessourceclient resource to be excluded from the search. May benull.- Returns:
- unique client resource name in the context of the given client
-
isNameExisiting
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
- Specified by:
getAllByMandantin interfaceIMandantRessourceDao
-
getAllByProject
Deprecated.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
- Overrides:
getPreActionHookin classGenericDao<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
- Specified by:
getUsedFileSizein interfaceIMandantRessourceDao
-