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 of
IMandantRessourceDao
that can be accessed via DaoProvider
.- Author:
- XIMA MEDIA GmbH
-
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) create
(IEntityContext ec, String name, byte[] daten, String userName, String fileName, String resourceDescription, Mandant mandant) findUniqueName
(IEntityContext ec, Mandant client, String candidate, MandantRessource exclude) Returns a name that is not taken by anotherMandantRessource
in the given client.getAllByExtension
(IEntityContext ec, Mandant client, Iterable<String> extensions) getAllByMandant
(IEntityContext ec, Mandant mandant) getAllByProject
(IEntityContext ec, Projekt project) Deprecated.getByName
(IEntityContext ec, Mandant mandant, String name) getByUUID
(IEntityContext ec, Mandant client, String uuid) Returns the client resource for the given UUID string and clientgetByUUID
(IEntityContext ec, Mandant client, UUID uuid) Returns the client resource for the given UUID and clientgetEntityRefs
(IEntityContext ec, MandantRessource resource) Returns a set of entities that reference the given entity and depend on it.protected IFCDaoActionHook<MandantRessource>
protected IFCDaoActionHook<MandantRessource>
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 clientupdate
(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 Details
-
MandantRessourceDao
public MandantRessourceDao()Creates a new instance of this DAO. Normally you should use the singleton instance provided byDaoProvider.MANDANTRESSOURCE_DAO
.
-
-
Method Details
-
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
- Specified by:
getByName
in interfaceIMandantRessourceDao
-
getByUUID
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
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
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
- Specified by:
getAllByMandant
in interfaceIMandantRessourceDao
-
getAllByProject
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
- Overrides:
getPreActionHook
in classGenericDao<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
- Specified by:
getUsedFileSize
in interfaceIMandantRessourceDao
-