Package de.xima.fc.dao.impl
Class ProjektRessourceDao
java.lang.Object
de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
de.xima.fc.dao.impl.GenericDao<E>
de.xima.fc.dao.impl.MandantDependentBaseDao<ProjektRessource>
de.xima.fc.dao.impl.ProjektRessourceDao
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<ProjektRessource,,Long, IEntityContext> IGenericDao<ProjektRessource>,IMandantDependentBaseDao<ProjektRessource>,IProjektRessourceDao
public class ProjektRessourceDao
extends MandantDependentBaseDao<ProjektRessource>
implements IProjektRessourceDao
-
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, Projekt projekt) create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant, Projekt projekt) findUniqueName(IEntityContext ec, Projekt project, String candidate, ProjektRessource exclude) Returns a name that is not taken by anotherProjektRessourcein the given project.getAllByExtension(IEntityContext ec, Projekt project, Iterable<String> extensions) getAllByProjekt(IEntityContext ec, Projekt projekt) getByName(IEntityContext ec, Projekt projekt, String name) getByUUID(IEntityContext ec, Projekt project, String uuid) Returns the project resource with the given UUID stringgetByUUID(IEntityContext ec, Projekt project, UUID uuid) Returns the project resource with the given UUIDgetEntityRefs(IEntityContext ec, ProjektRessource resource) Returns a set of entities that reference the given entity and depend on it.protected IFCDaoActionHook<ProjektRessource>protected IFCDaoActionHook<ProjektRessource>longgetUsedFileSize(IEntityContext ec, Mandant mandant) booleanisNameExisiting(IEntityContext ec, Projekt project, String name) Returns whether or not the given project resource name exists within the given projectupdate(IEntityContext ec, byte[] daten, String userName, String fileName, ProjektRessource 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.IProjektRessourceDao
getAllByProjekt, getByName
-
Constructor Details
-
ProjektRessourceDao
public ProjektRessourceDao()
-
-
Method Details
-
getEntityRefs
public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, ProjektRessource 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<ProjektRessource>- Overrides:
getEntityRefsin classGenericDao<ProjektRessource>- 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 interfaceIProjektRessourceDao
-
getByUUID
Description copied from interface:IProjektRessourceDaoReturns the project resource with the given UUID string- Specified by:
getByUUIDin interfaceIProjektRessourceDao- Parameters:
ec-IEntityContextto useproject-Projektcontext in which to look for resourceuuid-StringUUID string of the resource- Returns:
ProjektRessourcefor the given UUID and project
-
getByUUID
Description copied from interface:IProjektRessourceDaoReturns the project resource with the given UUID- Specified by:
getByUUIDin interfaceIProjektRessourceDao- Parameters:
ec-IEntityContextto useproject-Projektcontext in which to look for resourceuuid-UUIDUUID of the resource- Returns:
ProjektRessourcefor the given UUID and project
-
getAllByProjekt
- Specified by:
getAllByProjektin interfaceIProjektRessourceDao
-
getAllByExtension
public List<ProjektRessource> getAllByExtension(IEntityContext ec, Projekt project, Iterable<String> extensions) - Specified by:
getAllByExtensionin interfaceIProjektRessourceDao- Parameters:
ec- Current entity context for accessing the database.project- Project 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.
-
findUniqueName
public String findUniqueName(IEntityContext ec, Projekt project, String candidate, ProjektRessource exclude) Description copied from interface:IProjektRessourceDaoReturns a name that is not taken by anotherProjektRessourcein the given project. An index will be added to the candidate if necessary.- Specified by:
findUniqueNamein interfaceIProjektRessourceDao- Parameters:
ec-IEntityContextto be usedproject-Projektfor which a unique project resource name should be generatedcandidate-Stringproject resource name candidate to be made uniqueexclude-ProjektRessourceclient resource to be excluded from the search. May benullor may be an existing resource when updating.- Returns:
- unique project resource name in the context of the given client
-
isNameExisiting
Description copied from interface:IProjektRessourceDaoReturns whether or not the given project resource name exists within the given project- Specified by:
isNameExisitingin interfaceIProjektRessourceDao- Parameters:
ec-IEntityContextto be usedproject-Projektfor which to check uniquenessname-Stringproject resource name to check- Returns:
- whether or not the given name is unique
-
getPreActionHook
- Overrides:
getPreActionHookin classGenericDao<ProjektRessource>
-
getPostActionHook
- Overrides:
getPostActionHookin classGenericDao<ProjektRessource>
-
create
public ProjektRessource create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant, Projekt projekt) - Specified by:
createin interfaceIProjektRessourceDao
-
create
public ProjektRessource create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant, Projekt projekt) - Specified by:
createin interfaceIProjektRessourceDao
-
update
public ProjektRessource update(IEntityContext ec, byte[] daten, String userName, String fileName, ProjektRessource res) - Specified by:
updatein interfaceIProjektRessourceDao
-
getUsedFileSize
- Specified by:
getUsedFileSizein interfaceIProjektRessourceDao
-