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
-
-
Constructor Summary
Constructors Constructor Description ProjektRessourceDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjektRessourcecreate(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant, Projekt projekt)ProjektRessourcecreate(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant, Projekt projekt)StringfindUniqueName(IEntityContext ec, Projekt project, String candidate, ProjektRessource exclude)Returns a name that is not taken by anotherProjektRessourcein the given project.List<ProjektRessource>getAllByExtension(IEntityContext ec, Projekt project, Iterable<String> extensions)List<ProjektRessource>getAllByProjekt(IEntityContext ec, Projekt projekt)ProjektRessourcegetByName(IEntityContext ec, Projekt projekt, String name)ProjektRessourcegetByUUID(IEntityContext ec, Projekt project, String uuid)Returns the project resource with the given UUID stringProjektRessourcegetByUUID(IEntityContext ec, Projekt project, UUID uuid)Returns the project resource with the given UUIDSet<de.xima.cmn.dao.interfaces.IEntity<Long>>getEntityRefs(IEntityContext ec, ProjektRessource resource)protected IFCDaoActionHook<ProjektRessource>getPostActionHook()protected IFCDaoActionHook<ProjektRessource>getPreActionHook()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 projectProjektRessourceupdate(IEntityContext ec, byte[] daten, String userName, String fileName, ProjektRessource 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.IProjektRessourceDao
getAllByProjekt, getByName
-
-
-
-
Method Detail
-
getEntityRefs
public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, ProjektRessource resource)
- Specified by:
getEntityRefsin interfaceIGenericDao<ProjektRessource>- Overrides:
getEntityRefsin classGenericDao<ProjektRessource>
-
getByName
public ProjektRessource getByName(IEntityContext ec, Projekt projekt, String name)
- Specified by:
getByNamein interfaceIProjektRessourceDao
-
getByUUID
public ProjektRessource getByUUID(IEntityContext ec, Projekt project, String uuid)
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
public ProjektRessource getByUUID(IEntityContext ec, Projekt project, UUID uuid)
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
public List<ProjektRessource> getAllByProjekt(IEntityContext ec, Projekt projekt)
- 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
public boolean isNameExisiting(IEntityContext ec, Projekt project, String name)
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
protected IFCDaoActionHook<ProjektRessource> getPreActionHook()
- Overrides:
getPreActionHookin classGenericDao<ProjektRessource>
-
getPostActionHook
protected IFCDaoActionHook<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
public long getUsedFileSize(IEntityContext ec, Mandant mandant)
- Specified by:
getUsedFileSizein interfaceIProjektRessourceDao
-
-