Class HibernateMessageTemplateDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<MessageTemplate>
com.logicaldoc.core.communication.HibernateMessageTemplateDAO
- All Implemented Interfaces:
MessageTemplateDAO,PersistentObjectDAO<MessageTemplate>
public class HibernateMessageTemplateDAO
extends HibernatePersistentObjectDAO<MessageTemplate>
implements MessageTemplateDAO
Hibernate implementation of
MessageTemplateDAO- Since:
- 6.5
- Author:
- Marco Meschieri - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(long id, int code) This method deletes an entity and you can give a deletion codefindByLanguage(String language, long tenantId) Finds the templates by given languagefindByName(String name, long tenantId) Finds the templates by given name, you may have the same name but for different languages.findByNameAndLanguage(String name, String language, long tenantId) Finds the template by the alternate key.findByTypeAndLanguage(String type, String language, long tenantId) Finds the templates by the type.Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, setSessionFactory, storeMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, store
-
Constructor Details
-
HibernateMessageTemplateDAO
public HibernateMessageTemplateDAO()
-
-
Method Details
-
findByLanguage
public List<MessageTemplate> findByLanguage(String language, long tenantId) throws PersistenceException Description copied from interface:MessageTemplateDAOFinds the templates by given language- Specified by:
findByLanguagein interfaceMessageTemplateDAO- Parameters:
language- the languagetenantId- identifier of the tenant- Returns:
- collection of templates
- Throws:
PersistenceException- Error in the database
-
findByTypeAndLanguage
public List<MessageTemplate> findByTypeAndLanguage(String type, String language, long tenantId) throws PersistenceException Description copied from interface:MessageTemplateDAOFinds the templates by the type.- Specified by:
findByTypeAndLanguagein interfaceMessageTemplateDAO- Parameters:
type- type of the templatelanguage- the languagetenantId- the tenant- Returns:
- the found templates
- Throws:
PersistenceException- Error in the database
-
findByNameAndLanguage
public MessageTemplate findByNameAndLanguage(String name, String language, long tenantId) throws PersistenceException Description copied from interface:MessageTemplateDAOFinds the template by the alternate key. If the template is not found for the specified language, the 'en' will be used instead.- Specified by:
findByNameAndLanguagein interfaceMessageTemplateDAO- Parameters:
name- name of the templatelanguage- the language, if null 'en' will be used insteadtenantId- the tenant- Returns:
- The found template or the 'en' if none was found
- Throws:
PersistenceException- Error in the database
-
delete
Description copied from interface:PersistentObjectDAOThis method deletes an entity and you can give a deletion code- Specified by:
deletein interfacePersistentObjectDAO<MessageTemplate>- Overrides:
deletein classHibernatePersistentObjectDAO<MessageTemplate>- Parameters:
id- ID of the entity which should be deletedcode- Deletion code- Throws:
PersistenceException- raised in case of errors in the database
-
findByName
Description copied from interface:MessageTemplateDAOFinds the templates by given name, you may have the same name but for different languages.- Specified by:
findByNamein interfaceMessageTemplateDAO- Parameters:
name- name of the templatetenantId- identifier of the tenant- Returns:
- collection of templates
- Throws:
PersistenceException- Error in the database
-