Class TextbausteinDao
java.lang.Object
de.xima.cmn.dao.AbstractDao<Textbaustein, Long, IEntityContext>
- 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 of
ITextbausteinDao 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 TypeMethodDescriptionfindAllKeywords(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie) Collects all currently existing keywords for the provided client and template type.findUniqueName(IEntityContext ec, Mandant client, String candidate) Returns a name that is not taken by anotherTextbausteinin the given client.findUniqueName(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.getAll(IEntityContext ec, Mandant mandant) getAllByKat(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie) Returns the templates matching the providedMandantandETextbausteinKategorie.getAllByProject(IEntityContext ec, Projekt project) Returns all templates that are being used by the given projectgetByKatAndName(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie, String name) getByMsgCode(IEntityContext ec, Mandant client, ETextbausteinMsgCode messageCode, ETextbausteinKategorie category) getByMsgCode(IEntityContext ec, Mandant client, String messageCode) getByMsgCode(IEntityContext ec, Mandant client, String messageCode, ETextbausteinKategorie category) getByName(IEntityContext ec, Mandant mandant, String name) getByUUID(IEntityContext ec, Mandant client, String uuid) Returns the template with the given UUID stringgetByUUID(IEntityContext ec, Mandant client, UUID uuid) Returns the template with the given UUIDgetEntityRefs(IEntityContext ec, Textbaustein template) Returns a set of entities that reference the given entity and depend on it.protected IFCDaoActionHook<Textbaustein> protected IFCDaoActionHook<Textbaustein> getTextbausteinByMsgCode(IEntityContext ec, Mandant client, ETextbausteinMsgCode messageCode) booleanisNameExisiting(IEntityContext ec, Mandant client, String name) Checks whether the given template name exists within the given clientMethods inherited from class GenericDao
readMethods 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, updateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, updateMethods inherited from interface IGenericDao
count, createOrUpdate, findAll, findSingle, read
-
Constructor Details
-
TextbausteinDao
public TextbausteinDao()Creates a new instance of this DAO. Normally you should use the singleton instance provided byDaoProvider.TEXTBAUSTEIN_DAO.
-
-
Method Details
-
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 client, ETextbausteinMsgCode messageCode) - Specified by:
getTextbausteinByMsgCodein interfaceITextbausteinDao
-
getAll
- Specified by:
getAllin interfaceITextbausteinDao
-
getByName
- Specified by:
getByNamein interfaceITextbausteinDao
-
getAllByKat
public List<Textbaustein> getAllByKat(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie) Description copied from interface:ITextbausteinDaoReturns the templates matching the providedMandantandETextbausteinKategorie.- Specified by:
getAllByKatin interfaceITextbausteinDao- Parameters:
ec-IEntityContextto usemandant-Mandantcontext in which to look for templatekategorie-ETextbausteinKategorieto filter the templates by- Returns:
- the resulting list of templates, ordered by template name (ASC)
-
getByMsgCode
- Specified by:
getByMsgCodein interfaceITextbausteinDao
-
getByMsgCode
public Textbaustein getByMsgCode(IEntityContext ec, Mandant client, ETextbausteinMsgCode messageCode, ETextbausteinKategorie category) - Specified by:
getByMsgCodein interfaceITextbausteinDao
-
getByMsgCode
public Textbaustein getByMsgCode(IEntityContext ec, Mandant client, String messageCode, ETextbausteinKategorie category) - Specified by:
getByMsgCodein interfaceITextbausteinDao
-
getByKatAndName
public Textbaustein getByKatAndName(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie, String name) - Specified by:
getByKatAndNamein interfaceITextbausteinDao
-
getByUUID
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
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
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
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- Candidate name for the template. This name is used when it does not exist, otherwise a unique name is derived based on this name.- 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- Candidate name for the template. This name is used when it does not exist, otherwise a unique name is derived based on this name.exclude-Textbausteintemplate to be excluded from search- Returns:
- unique template name in the context of the given client
-
isNameExisiting
Description copied from interface:ITextbausteinDaoChecks whether 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 the given name is unique
-
findAllKeywords
public Set<String> findAllKeywords(IEntityContext ec, Mandant mandant, ETextbausteinKategorie kategorie) Description copied from interface:ITextbausteinDaoCollects all currently existing keywords for the provided client and template type.- Specified by:
findAllKeywordsin interfaceITextbausteinDao- Parameters:
ec-IEntityContextto be usedmandant-Mandantto filter the templates bykategorie-ETextbausteinKategorieto filter the templates by- Returns:
- the resulting (unordered) set of keywords
-
getPreActionHook
- Overrides:
getPreActionHookin classGenericDao<Textbaustein>
-
getPostActionHook
- Overrides:
getPostActionHookin classGenericDao<Textbaustein>
-