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 ofIMandantRessourceDao
that can be accessed viaDaoProvider
.- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description MandantRessourceDao()
Creates a new instance of this DAO.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated 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)
Deprecated.MandantRessource
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)
Returns a set of entities that reference the given entity and depend on it.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
count, findAll, findSingle, read
-
Methods inherited from interface de.xima.fc.dao.interfaces.IMandantRessourceDao
getAllByMandant, getByName
-
-
-
-
Constructor Detail
-
MandantRessourceDao
public MandantRessourceDao()
Creates a new instance of this DAO. Normally you should use the singleton instance provided byDaoProvider.MANDANTRESSOURCE_DAO
.
-
-
Method Detail
-
getEntityRefs
public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, MandantRessource resource)
Description copied from interface:IGenericDao
Returns 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:
getEntityRefs
in interfaceIGenericDao<MandantRessource>
- Overrides:
getEntityRefs
in 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
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 candidate to be made uniqueexclude
-MandantRessource
client resource to be excluded from the search. May benull
.- 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
@Deprecated public List<MandantRessource> getAllByProject(IEntityContext ec, Projekt project)
Deprecated.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
-
-