Package de.xima.fc.dao.impl
Class TextbausteinDao
- java.lang.Object
-
- de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
-
- de.xima.fc.dao.impl.GenericDao<E>
-
- de.xima.fc.dao.impl.MandantDependentBaseDao<Textbaustein>
-
- de.xima.fc.dao.impl.TextbausteinDao
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<Textbaustein,Long,IEntityContext>,IGenericDao<Textbaustein>,IMandantDependentBaseDao<Textbaustein>,ITextbausteinDao
public class TextbausteinDao extends MandantDependentBaseDao<Textbaustein> implements ITextbausteinDao
The default implementation ofITextbausteinDaothat can be accessed viaDaoProvider.- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description TextbausteinDao()Creates a new instance of this DAO.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringfindUniqueName(IEntityContext ec, Mandant client, String candidate)Returns a name that is not taken by anotherTextbausteinin the given client.StringfindUniqueName(IEntityContext ec, Mandant client, String candidate, Textbaustein exclude)Returns a name that is not taken by anotherTextbausteinin the given client other than the excluded template.List<Textbaustein>getAll(IEntityContext ec, Mandant mandant)List<Textbaustein>getAllByKat(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie)List<Textbaustein>getAllByProject(IEntityContext ec, Projekt project)Returns all templates that are being used by the given projectTextbausteingetByKatAndName(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie, String name)TextbausteingetByMsgCode(IEntityContext ec, Mandant m, String msgCode)TextbausteingetByName(IEntityContext ec, Mandant mandant, String name)TextbausteingetByUUID(IEntityContext ec, Mandant client, String uuid)Returns the template with the given UUID stringTextbausteingetByUUID(IEntityContext ec, Mandant client, UUID uuid)Returns the template with the given UUIDSet<de.xima.cmn.dao.interfaces.IEntity<Long>>getEntityRefs(IEntityContext ec, Textbaustein template)Returns a set of entities that reference the given entity and depend on it.protected IFCDaoActionHook<Textbaustein>getPostActionHook()protected IFCDaoActionHook<Textbaustein>getPreActionHook()TextbausteingetTextbausteinByMsgCode(IEntityContext ec, Mandant m, ETextbausteinMsgCode msgCode)booleanisNameExisiting(IEntityContext ec, Mandant client, String name)Returns whether or not the given template name exists within the given client-
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
-
-
-
-
Constructor Detail
-
TextbausteinDao
public TextbausteinDao()
Creates a new instance of this DAO. Normally you should use the singleton instance provided byDaoProvider.TEXTBAUSTEIN_DAO.
-
-
Method Detail
-
getEntityRefs
public Set<de.xima.cmn.dao.interfaces.IEntity<Long>> getEntityRefs(IEntityContext ec, Textbaustein template)
Description copied from interface:IGenericDaoReturns 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:
getEntityRefsin interfaceIGenericDao<Textbaustein>- Overrides:
getEntityRefsin classGenericDao<Textbaustein>- Parameters:
ec- entity context for database transactions.template- to get references for.- Returns:
- a set of entities that reference the given entity and depend on it.
-
getTextbausteinByMsgCode
public Textbaustein getTextbausteinByMsgCode(IEntityContext ec, Mandant m, ETextbausteinMsgCode msgCode)
- Specified by:
getTextbausteinByMsgCodein interfaceITextbausteinDao
-
getAll
public List<Textbaustein> getAll(IEntityContext ec, Mandant mandant)
- Specified by:
getAllin interfaceITextbausteinDao
-
getByName
public Textbaustein getByName(IEntityContext ec, Mandant mandant, String name)
- Specified by:
getByNamein interfaceITextbausteinDao
-
getAllByKat
public List<Textbaustein> getAllByKat(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie)
- Specified by:
getAllByKatin interfaceITextbausteinDao
-
getByMsgCode
public Textbaustein getByMsgCode(IEntityContext ec, Mandant m, String msgCode)
- Specified by:
getByMsgCodein interfaceITextbausteinDao
-
getByKatAndName
public Textbaustein getByKatAndName(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie, String name)
- Specified by:
getByKatAndNamein interfaceITextbausteinDao
-
getByUUID
public Textbaustein getByUUID(IEntityContext ec, Mandant client, String uuid)
Description copied from interface:ITextbausteinDaoReturns the template with the given UUID string- Specified by:
getByUUIDin interfaceITextbausteinDao- Parameters:
ec-IEntityContextto useclient-Mandantcontext in which to look for templateuuid-StringUUID of the template- Returns:
Textbausteinfor the given UUID and client
-
getByUUID
public Textbaustein getByUUID(IEntityContext ec, Mandant client, UUID uuid)
Description copied from interface:ITextbausteinDaoReturns the template with the given UUID- Specified by:
getByUUIDin interfaceITextbausteinDao- Parameters:
ec-IEntityContextto useclient-Mandantcontext in which to look for templateuuid-UUIDUUID of the template- Returns:
Textbausteinfor the given UUID and client
-
getAllByProject
public List<Textbaustein> getAllByProject(IEntityContext ec, Projekt project)
Description copied from interface:ITextbausteinDaoReturns all templates that are being used by the given project- Specified by:
getAllByProjectin interfaceITextbausteinDao- Parameters:
ec-IEntityContextto be usedproject-Projektproject to search for templates- Returns:
ListofTextbausteins that are being used by the project
-
findUniqueName
public String findUniqueName(IEntityContext ec, Mandant client, String candidate)
Description copied from interface:ITextbausteinDaoReturns a name that is not taken by anotherTextbausteinin the given client. An index will be added to the candidate if necessary.- Specified by:
findUniqueNamein interfaceITextbausteinDao- Parameters:
ec-IEntityContextto be usedclient-Mandantfor which a unique template name should be generatedcandidate-Stringtemplate name candiate to be made unique- Returns:
- unique template name in the context of the given client
-
findUniqueName
public String findUniqueName(IEntityContext ec, Mandant client, String candidate, Textbaustein exclude)
Description copied from interface:ITextbausteinDaoReturns a name that is not taken by anotherTextbausteinin the given client other than the excluded template. An index will be added to the candidate if necessary.- Specified by:
findUniqueNamein interfaceITextbausteinDao- Parameters:
ec-IEntityContextto be usedclient-Mandantfor which a unique template name should be generatedcandidate-Stringtemplate name candiate to be made uniqueexclude-Textbausteintemplate to be excluded from search- Returns:
- unique template name in the context of the given client
-
isNameExisiting
public boolean isNameExisiting(IEntityContext ec, Mandant client, String name)
Description copied from interface:ITextbausteinDaoReturns whether or not the given template name exists within the given client- Specified by:
isNameExisitingin interfaceITextbausteinDao- Parameters:
ec-IEntityContextto be usedclient-Mandantfor which to check uniquenessname-Stringtemplate name to check- Returns:
- whether or not the given name is unique
-
getPreActionHook
protected IFCDaoActionHook<Textbaustein> getPreActionHook()
- Overrides:
getPreActionHookin classGenericDao<Textbaustein>
-
getPostActionHook
protected IFCDaoActionHook<Textbaustein> getPostActionHook()
- Overrides:
getPostActionHookin classGenericDao<Textbaustein>
-
-