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 ofMessageTemplateDAO
- Since:
- 6.5
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description HibernateMessageTemplateDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete(long id, int code)
This method deletes an entity and you can give a deletion codeList<MessageTemplate>
findByLanguage(String language, long tenantId)
Finds the templates by given languageList<MessageTemplate>
findByName(String name, long tenantId)
Finds the templates by given name, you may have the same name but for different languages.MessageTemplate
findByNameAndLanguage(String name, String language, long tenantId)
Finds the template by the alternate key.List<MessageTemplate>
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, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, setSessionFactory, store
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
findByLanguage
public List<MessageTemplate> findByLanguage(String language, long tenantId)
Description copied from interface:MessageTemplateDAO
Finds the templates by given language- Specified by:
findByLanguage
in interfaceMessageTemplateDAO
- Parameters:
language
- the languagetenantId
- identifier of the tenant- Returns:
- collection of templates
-
findByTypeAndLanguage
public List<MessageTemplate> findByTypeAndLanguage(String type, String language, long tenantId)
Description copied from interface:MessageTemplateDAO
Finds the templates by the type.- Specified by:
findByTypeAndLanguage
in interfaceMessageTemplateDAO
- Parameters:
type
- type of the templatelanguage
- the languagetenantId
- the tenant- Returns:
- the found templates
-
findByNameAndLanguage
public MessageTemplate findByNameAndLanguage(String name, String language, long tenantId)
Description copied from interface:MessageTemplateDAO
Finds the template by the alternate key. If the template is not found for the specified language, the 'en' will be used instead.- Specified by:
findByNameAndLanguage
in 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
-
delete
public boolean delete(long id, int code)
Description copied from interface:PersistentObjectDAO
This method deletes an entity and you can give a deletion code- Specified by:
delete
in interfacePersistentObjectDAO<MessageTemplate>
- Overrides:
delete
in classHibernatePersistentObjectDAO<MessageTemplate>
- Parameters:
id
- ID of the entity which should be deletedcode
- Deletion code- Returns:
- if the record has been successfully deleted
-
findByName
public List<MessageTemplate> findByName(String name, long tenantId)
Description copied from interface:MessageTemplateDAO
Finds the templates by given name, you may have the same name but for different languages.- Specified by:
findByName
in interfaceMessageTemplateDAO
- Parameters:
name
- name of the templatetenantId
- identifier of the tenant- Returns:
- collection of templates
-
-