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 ProjektRessource
create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant, Projekt projekt)
ProjektRessource
create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant, Projekt projekt)
String
findUniqueName(IEntityContext ec, Projekt project, String candidate, ProjektRessource exclude)
Returns a name that is not taken by anotherProjektRessource
in the given project.List<ProjektRessource>
getAllByExtension(IEntityContext ec, Projekt project, Iterable<String> extensions)
List<ProjektRessource>
getAllByProjekt(IEntityContext ec, Projekt projekt)
ProjektRessource
getByName(IEntityContext ec, Projekt projekt, String name)
ProjektRessource
getByUUID(IEntityContext ec, Projekt project, String uuid)
Returns the project resource with the given UUID stringProjektRessource
getByUUID(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()
long
getUsedFileSize(IEntityContext ec, Mandant mandant)
boolean
isNameExisiting(IEntityContext ec, Projekt project, String name)
Returns whether or not the given project resource name exists within the given projectProjektRessource
update(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:
getEntityRefs
in interfaceIGenericDao<ProjektRessource>
- Overrides:
getEntityRefs
in classGenericDao<ProjektRessource>
-
getByName
public ProjektRessource getByName(IEntityContext ec, Projekt projekt, String name)
- Specified by:
getByName
in interfaceIProjektRessourceDao
-
getByUUID
public ProjektRessource getByUUID(IEntityContext ec, Projekt project, String uuid)
Description copied from interface:IProjektRessourceDao
Returns the project resource with the given UUID string- Specified by:
getByUUID
in interfaceIProjektRessourceDao
- Parameters:
ec
-IEntityContext
to useproject
-Projekt
context in which to look for resourceuuid
-String
UUID string of the resource- Returns:
ProjektRessource
for the given UUID and project
-
getByUUID
public ProjektRessource getByUUID(IEntityContext ec, Projekt project, UUID uuid)
Description copied from interface:IProjektRessourceDao
Returns the project resource with the given UUID- Specified by:
getByUUID
in interfaceIProjektRessourceDao
- Parameters:
ec
-IEntityContext
to useproject
-Projekt
context in which to look for resourceuuid
-UUID
UUID of the resource- Returns:
ProjektRessource
for the given UUID and project
-
getAllByProjekt
public List<ProjektRessource> getAllByProjekt(IEntityContext ec, Projekt projekt)
- Specified by:
getAllByProjekt
in interfaceIProjektRessourceDao
-
getAllByExtension
public List<ProjektRessource> getAllByExtension(IEntityContext ec, Projekt project, Iterable<String> extensions)
- Specified by:
getAllByExtension
in 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:IProjektRessourceDao
Returns a name that is not taken by anotherProjektRessource
in the given project. An index will be added to the candidate if necessary.- Specified by:
findUniqueName
in interfaceIProjektRessourceDao
- Parameters:
ec
-IEntityContext
to be usedproject
-Projekt
for which a unique project resource name should be generatedcandidate
-String
project resource name candidate to be made uniqueexclude
-ProjektRessource
client resource to be excluded from the search. May benull
or 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:IProjektRessourceDao
Returns whether or not the given project resource name exists within the given project- Specified by:
isNameExisiting
in interfaceIProjektRessourceDao
- Parameters:
ec
-IEntityContext
to be usedproject
-Projekt
for which to check uniquenessname
-String
project resource name to check- Returns:
- whether or not the given name is unique
-
getPreActionHook
protected IFCDaoActionHook<ProjektRessource> getPreActionHook()
- Overrides:
getPreActionHook
in classGenericDao<ProjektRessource>
-
getPostActionHook
protected IFCDaoActionHook<ProjektRessource> getPostActionHook()
- Overrides:
getPostActionHook
in classGenericDao<ProjektRessource>
-
create
public ProjektRessource create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant, Projekt projekt)
- Specified by:
create
in interfaceIProjektRessourceDao
-
create
public ProjektRessource create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant, Projekt projekt)
- Specified by:
create
in interfaceIProjektRessourceDao
-
update
public ProjektRessource update(IEntityContext ec, byte[] daten, String userName, String fileName, ProjektRessource res)
- Specified by:
update
in interfaceIProjektRessourceDao
-
getUsedFileSize
public long getUsedFileSize(IEntityContext ec, Mandant mandant)
- Specified by:
getUsedFileSize
in interfaceIProjektRessourceDao
-
-