Package org.europa.together.application
Class ConfigurationHbmDAO
java.lang.Object
org.europa.together.application.GenericHbmDAO<ConfigurationDO,String>
org.europa.together.application.ConfigurationHbmDAO
- All Implemented Interfaces:
Serializable,ConfigurationDAO,GenericDAO<ConfigurationDO,String>
@Repository
@Transactional
public class ConfigurationHbmDAO
extends GenericHbmDAO<ConfigurationDO,String>
implements ConfigurationDAO
Implementation of the ConfigurationDAO.
- See Also:
-
Field Summary
Fields inherited from class org.europa.together.application.GenericHbmDAO
mainEntityManagerFactoryFields inherited from interface org.europa.together.business.ConfigurationDAO
FEATURE_IDFields inherited from interface org.europa.together.business.GenericDAO
FEATURE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllConfigurationSetEntries(String module, String version, String configSet) Return a List with all configuration objects of a ConfigurationSet.A ConfigurationSet is a collection of all configuration entries of one version for a service like email inside a module.Return a List of all deprecated ConfigurationDO.getAllModuleEntries(String module) Get all configuration entries for a module.getConfigurationByKey(String key, String module, String version) Get the whole configuration object by a given key, module and the version of the module.getHistoryOfAEntry(String module, String key, String configSet) In the case that for a module exist more versions than one.getValueByKey(String key, String module, String version) Return the value of a key from a module.voidRestore a single entry to his default value.voidupdateConfigurationEntries(List<ConfigurationDO> configuration) Update a List of existing configuration entries.Methods inherited from class org.europa.together.application.GenericHbmDAO
countAllElements, create, delete, deserializeJsonAsList, deserializeJsonAsObject, deserializeJsonAsObject, find, getPrimaryKeyOfObject, listAllElements, serializeAsJson, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.europa.together.business.GenericDAO
countAllElements, create, delete, deserializeJsonAsList, deserializeJsonAsObject, deserializeJsonAsObject, find, getPrimaryKeyOfObject, listAllElements, serializeAsJson, update
-
Constructor Details
-
ConfigurationHbmDAO
public ConfigurationHbmDAO()Constructor.
-
-
Method Details
-
updateConfigurationEntries
Description copied from interface:ConfigurationDAOUpdate a List of existing configuration entries.- Specified by:
updateConfigurationEntriesin interfaceConfigurationDAO- Parameters:
configuration- as List<Configuration>- Throws:
DAOException- in case of error
-
getConfigurationByKey
@Transactional(readOnly=true) public ConfigurationDO getConfigurationByKey(String key, String module, String version) Description copied from interface:ConfigurationDAOGet the whole configuration object by a given key, module and the version of the module.- Specified by:
getConfigurationByKeyin interfaceConfigurationDAO- Parameters:
key- as Stringmodule- as Stringversion- as String- Returns:
- configuration as Object
-
getAllConfigurationSetEntries
@Transactional(readOnly=true) public List<ConfigurationDO> getAllConfigurationSetEntries(String module, String version, String configSet) Description copied from interface:ConfigurationDAOReturn a List with all configuration objects of a ConfigurationSet.A ConfigurationSet is a collection of all configuration entries of one version for a service like email inside a module.- Specified by:
getAllConfigurationSetEntriesin interfaceConfigurationDAO- Parameters:
module- as Stringversion- as StringconfigSet- as Sting- Returns:
- ConfigurationSet as List<Configuration>
-
getAllModuleEntries
Description copied from interface:ConfigurationDAOGet all configuration entries for a module.- Specified by:
getAllModuleEntriesin interfaceConfigurationDAO- Parameters:
module- as String- Returns:
- ConfigurationSet as List<Configuration>
-
getAllDeprecatedEntries
Description copied from interface:ConfigurationDAOReturn a List of all deprecated ConfigurationDO.- Specified by:
getAllDeprecatedEntriesin interfaceConfigurationDAO- Returns:
- deprecated as List<Configuration>
-
getHistoryOfAEntry
@Transactional(readOnly=true) public List<ConfigurationDO> getHistoryOfAEntry(String module, String key, String configSet) Description copied from interface:ConfigurationDAOIn the case that for a module exist more versions than one. For example after some upgrades, this method supports a history function of the previous configuration.- Specified by:
getHistoryOfAEntryin interfaceConfigurationDAO- Parameters:
module- as Stringkey- as StringconfigSet- as String- Returns:
- history as List<Configuration>
-
getValueByKey
@Transactional(readOnly=true) public String getValueByKey(String key, String module, String version) Description copied from interface:ConfigurationDAOReturn the value of a key from a module. The hashing of the key will be done in this function, so the usage is more easy. The identifier for a configuration entry is a combination of the key itself, the module-name and the module-version were the DAO stored who use the module. e. g.: E-Mail Configuration is implemented in core, since version 1.0 In the case a entry exist but the value is empty, then the default value will used.- Specified by:
getValueByKeyin interfaceConfigurationDAO- Parameters:
key- as Stringmodule- as Stringversion- as String- Returns:
- value as String
-
restoreKeyToDefault
Description copied from interface:ConfigurationDAORestore a single entry to his default value.- Specified by:
restoreKeyToDefaultin interfaceConfigurationDAO- Parameters:
entry- as Configuration- Throws:
DAOException- in case of error
-