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
mainEntityManagerFactory
Fields inherited from interface org.europa.together.business.ConfigurationDAO
FEATURE_ID
Fields inherited from interface org.europa.together.business.GenericDAO
FEATURE_ID
-
Constructor Summary
-
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.void
Restore a single entry to his default value.void
updateConfigurationEntries
(List<ConfigurationDO> configuration) Update a List of existing configuration entries.Methods inherited from class org.europa.together.application.GenericHbmDAO
countAllElements, create, delete, deserializeJsonAsList, deserializeJsonAsObject, find, getPrimaryKeyOfObject, listAllElements, serializeAsJson, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.europa.together.business.GenericDAO
countAllElements, create, delete, deserializeJsonAsList, deserializeJsonAsObject, find, getPrimaryKeyOfObject, listAllElements, serializeAsJson, update
-
Constructor Details
-
ConfigurationHbmDAO
public ConfigurationHbmDAO()Constructor.
-
-
Method Details
-
updateConfigurationEntries
Description copied from interface:ConfigurationDAO
Update a List of existing configuration entries.- Specified by:
updateConfigurationEntries
in interfaceConfigurationDAO
- Parameters:
configuration
- as List<Configuration>- Throws:
DAOException
-
getConfigurationByKey
@Transactional(readOnly=true) public ConfigurationDO getConfigurationByKey(String key, String module, String version) Description copied from interface:ConfigurationDAO
Get the whole configuration object by a given key, module and the version of the module.- Specified by:
getConfigurationByKey
in 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:ConfigurationDAO
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.- Specified by:
getAllConfigurationSetEntries
in interfaceConfigurationDAO
- Parameters:
module
- as Stringversion
- as StringconfigSet
- as Sting- Returns:
- ConfigurationSet as List<Configuration>
-
getAllModuleEntries
Description copied from interface:ConfigurationDAO
Get all configuration entries for a module.- Specified by:
getAllModuleEntries
in interfaceConfigurationDAO
- Parameters:
module
- as String- Returns:
- ConfigurationSet as List<Configuration>
-
getAllDeprecatedEntries
Description copied from interface:ConfigurationDAO
Return a List of all deprecated ConfigurationDO.- Specified by:
getAllDeprecatedEntries
in interfaceConfigurationDAO
- Returns:
- deprecated as List<Configuration>
-
getHistoryOfAEntry
@Transactional(readOnly=true) public List<ConfigurationDO> getHistoryOfAEntry(String module, String key, String configSet) Description copied from interface:ConfigurationDAO
In 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:
getHistoryOfAEntry
in 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:ConfigurationDAO
Return 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:
getValueByKey
in interfaceConfigurationDAO
- Parameters:
key
- as Stringmodule
- as Stringversion
- as String- Returns:
- value as String
-
restoreKeyToDefault
Description copied from interface:ConfigurationDAO
Restore a single entry to his default value.- Specified by:
restoreKeyToDefault
in interfaceConfigurationDAO
- Parameters:
entry
- as Configuration- Throws:
DAOException
-