public abstract class AbstractConfigurationJPADaoImpl<C extends AbstractConfiguration> extends AbstractQueryableDaoImpl<C> implements ConfigurationDao<String,String,C>, Serializable
AbstractConfiguration
class for other modules to extend.
EntityManager
maybe null and hence checked for in some methods.em
ct, t
NAMESPACE_DELIM
Constructor and Description |
---|
AbstractConfigurationJPADaoImpl() |
Modifier and Type | Method and Description |
---|---|
void |
delete(C config)
Remove a configuration
|
Map |
get(String namespace)
Get a Map of key name and corresponding
IConfiguration for the specific namespace. |
String |
get(String namespace,
String key)
Will throw an exception if it did not find any matching result for the Config
Note: param matching is case insensitive |
String |
get(User user,
String namespace,
String key)
Get a configuration in the context to a
User |
Map |
getAll(String namespace)
Get a Map of key name and corresponding
AbstractConfiguration for the specific namespace. |
C |
getConfig(C proxy) |
C |
getConfig(String namespace,
String key) |
List<C> |
getConfigs(String namespace)
Get configurations for a namespace and nested namesapces, as a collection of C
|
List<String> |
getNamespaces()
Get list of namespaces
|
C |
put(C config)
Updates the configurations and returns the updated configuration object for chaining
|
conditionConstruct, count, ensureRowIsEntity, ensureRowIsEntity, getEntityInstance, getQueryObject, query, query, queryPage, queryPage
delete, getEntityManager, getNativeEntityName, load, load, paginate, query, query, save, setEntityManager, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
delete, load, load, save
public C put(C config)
put
in interface ConfigurationDao<String,String,C extends AbstractConfiguration>
{@link
- AbstractConfiguration} (Generic type extends Configuration)public C getConfig(C proxy)
getConfig
in interface ConfigurationDao<String,String,C extends AbstractConfiguration>
public C getConfig(String namespace, String key)
getConfig
in interface ConfigurationDao<String,String,C extends AbstractConfiguration>
namespace
- as Stringkey
- as StringAbstractConfiguration
public String get(String namespace, String key)
get
in interface ConfigurationDao<String,String,C extends AbstractConfiguration>
get
in interface ConfigurationSource<String,String>
namespace
- as Stringkey
- as StringAbstractConfiguration
(Generic type extends Configuration) @nullable true, if no config existsException
public String get(User user, String namespace, String key)
ConfigurationSource
User
get
in interface ConfigurationSource<String,String>
public Map get(String namespace)
IConfiguration
for the specific namespace.
get
in interface ConfigurationSource<String,String>
namespace
- as StringIConfiguration
public Map getAll(String namespace)
ConfigurationDao
AbstractConfiguration
for the specific namespace.
ConfigurationSource.NAMESPACE_DELIM
This method respects hierarchy based on default convention.getAll
in interface ConfigurationDao<String,String,C extends AbstractConfiguration>
namespace
- as StringAbstractConfiguration
public List<String> getNamespaces()
ConfigurationDao
getNamespaces
in interface ConfigurationDao<String,String,C extends AbstractConfiguration>
public List<C> getConfigs(String namespace)
ConfigurationDao
getConfigs
in interface ConfigurationDao<String,String,C extends AbstractConfiguration>
namespace
- as StringCollection
of Cpublic void delete(C config)
ConfigurationDao
delete
in interface ConfigurationDao<String,String,C extends AbstractConfiguration>
delete
in interface GenericDao<C extends AbstractConfiguration>
delete
in class GenericDaoImpl<C extends AbstractConfiguration>
Copyright © 2018. All rights reserved.