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 MandantRessource
create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant)
MandantRessource
create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant)
String
findUniqueName(IEntityContext ec, Mandant client, String candidate, MandantRessource exclude)
Returns a name that is not taken by anotherMandantRessource
in 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 projectMandantRessource
getByName(IEntityContext ec, Mandant mandant, String name)
MandantRessource
getByUUID(IEntityContext ec, Mandant client, String uuid)
Returns the client resource for the given UUID string and clientMandantRessource
getByUUID(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()
long
getUsedFileSize(IEntityContext ec, Mandant mandant)
boolean
isNameExisiting(IEntityContext ec, Mandant client, String name)
Returns whether or not the given client resource name exists within the given clientMandantRessource
update(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:
getEntityRefs
in interfaceIGenericDao<MandantRessource>
- Overrides:
getEntityRefs
in classGenericDao<MandantRessource>
-
getByName
public MandantRessource getByName(IEntityContext ec, Mandant mandant, String name)
- Specified by:
getByName
in interfaceIMandantRessourceDao
-
getByUUID
public MandantRessource getByUUID(IEntityContext ec, Mandant client, String uuid)
Description copied from interface:IMandantRessourceDao
Returns the client resource for the given UUID string and client- Specified by:
getByUUID
in interfaceIMandantRessourceDao
- Parameters:
ec
-IEntityContext
to useclient
-Mandant
context in which to look for resourceuuid
-String
UUID string of the resource- Returns:
MandantRessource
for the given UUID and client
-
getByUUID
public MandantRessource getByUUID(IEntityContext ec, Mandant client, UUID uuid)
Description copied from interface:IMandantRessourceDao
Returns the client resource for the given UUID and client- Specified by:
getByUUID
in interfaceIMandantRessourceDao
- Parameters:
ec
-IEntityContext
to useclient
-Mandant
context in which to look for resourceuuid
-UUID
UUID of the resource- Returns:
MandantRessource
for the given UUID and client
-
findUniqueName
public String findUniqueName(IEntityContext ec, Mandant client, String candidate, MandantRessource exclude)
Description copied from interface:IMandantRessourceDao
Returns a name that is not taken by anotherMandantRessource
in the given client. An index will be added to the candidate if necessary.- Specified by:
findUniqueName
in interfaceIMandantRessourceDao
- Parameters:
ec
-IEntityContext
to be usedclient
-Mandant
for which a unique client resource name should be generatedcandidate
-String
client resource name candiate to be made uniqueexclude
-MandantRessource
client 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:IMandantRessourceDao
Returns whether or not the given client resource name exists within the given client- Specified by:
isNameExisiting
in interfaceIMandantRessourceDao
- Parameters:
ec
-IEntityContext
to be usedclient
-Mandant
for which to check uniquenessname
-String
client resource name to check- Returns:
- whether or not the given name is unique
-
getAllByMandant
public List<MandantRessource> getAllByMandant(IEntityContext ec, Mandant mandant)
- Specified by:
getAllByMandant
in interfaceIMandantRessourceDao
-
getAllByProject
public List<MandantRessource> getAllByProject(IEntityContext ec, Projekt project)
Description copied from interface:IMandantRessourceDao
Returns all client resources that are being used by the given project- Specified by:
getAllByProject
in interfaceIMandantRessourceDao
- Parameters:
ec
- Current entity context for accessing the database.project
- A project where to search.- Returns:
- A list of
client resources
that are used by the project's workflow configration.
-
getAllByExtension
public List<MandantRessource> getAllByExtension(IEntityContext ec, Mandant client, Iterable<String> extensions)
- Specified by:
getAllByExtension
in 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:
getPreActionHook
in classGenericDao<MandantRessource>
-
getPostActionHook
protected IFCDaoActionHook<MandantRessource> getPostActionHook()
- Overrides:
getPostActionHook
in classGenericDao<MandantRessource>
-
create
public MandantRessource create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant)
- Specified by:
create
in interfaceIMandantRessourceDao
-
create
public MandantRessource create(IEntityContext ec, String name, byte[] daten, String userName, String fileName, Mandant mandant)
- Specified by:
create
in interfaceIMandantRessourceDao
-
update
public MandantRessource update(IEntityContext ec, byte[] daten, String userName, String fileName, MandantRessource res)
- Specified by:
update
in interfaceIMandantRessourceDao
-
getUsedFileSize
public long getUsedFileSize(IEntityContext ec, Mandant mandant)
- Specified by:
getUsedFileSize
in interfaceIMandantRessourceDao
-
-