Package de.xima.fc.dao.impl
Class SystemPropertyDao
- java.lang.Object
-
- de.xima.cmn.dao.AbstractDao<T,Long,IEntityContext>
-
- de.xima.fc.dao.impl.GenericDao<SystemProperty>
-
- de.xima.fc.dao.impl.SystemPropertyDao
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<SystemProperty,Long,IEntityContext>
,IGenericDao<SystemProperty>
,ISystemPropertyDao
public class SystemPropertyDao extends GenericDao<SystemProperty> implements ISystemPropertyDao
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description SystemPropertyDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystemProperty
createProperty(IEntityContext ec, String key, String value)
void
deleteProperty(IEntityContext ec, String key)
boolean
getBooleanValue(IEntityContext ec, String key, boolean defaultValue)
SystemProperty
getByKey(IEntityContext ec, String key)
List<SystemProperty>
getByKeyPrefix(IEntityContext ec, String keyPrefix)
Gets a list with all system properties that have a name starting with the given prefix.Map<String,String>
getByKeyPrefixAsMap(IEntityContext ec, String keyPrefix)
Gets a map with all system properties that have a name starting with the given prefix.List<SystemProperty>
getByKeys(IEntityContext ec, List<String> keys)
FormThemeReference
getDefaultSystemFormTheme(IEntityContext ec)
Gets the form theme that was configured as the default theme for the entire system.int
getIntegerValue(IEntityContext ec, String key, int defaultValue)
long
getLongValue(IEntityContext ec, String key, long defaultValue)
String
getStringValue(IEntityContext ec, String key, String defaultValue)
Returns the String value of the system property with the given key if it exists.void
updateProperties(IEntityContext ec, Map<String,String> properties)
Writes all given properties to the database.SystemProperty
updateProperty(IEntityContext ec, String key, String value)
-
Methods inherited from class de.xima.fc.dao.impl.GenericDao
getEntityRefs, getPostActionHook, getPreActionHook, read
-
Methods inherited from class de.xima.cmn.dao.AbstractDao
all, bulkDelete, bulkUpdate, cb, checkLockingVersion, cq, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, notifyListener, notifyListener, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, update
-
Methods inherited from interface de.xima.fc.dao.interfaces.IGenericDao
count, findAll, findSingle, getEntityRefs, read
-
-
-
-
Method Detail
-
getBooleanValue
public boolean getBooleanValue(IEntityContext ec, String key, boolean defaultValue)
- Specified by:
getBooleanValue
in interfaceISystemPropertyDao
-
getIntegerValue
public int getIntegerValue(IEntityContext ec, String key, int defaultValue)
- Specified by:
getIntegerValue
in interfaceISystemPropertyDao
-
getLongValue
public long getLongValue(IEntityContext ec, String key, long defaultValue)
- Specified by:
getLongValue
in interfaceISystemPropertyDao
-
getByKey
public SystemProperty getByKey(IEntityContext ec, String key)
- Specified by:
getByKey
in interfaceISystemPropertyDao
-
getByKeys
public List<SystemProperty> getByKeys(IEntityContext ec, List<String> keys)
- Specified by:
getByKeys
in interfaceISystemPropertyDao
-
getByKeyPrefix
public List<SystemProperty> getByKeyPrefix(IEntityContext ec, String keyPrefix)
Description copied from interface:ISystemPropertyDao
Gets a list with all system properties that have a name starting with the given prefix.- Specified by:
getByKeyPrefix
in interfaceISystemPropertyDao
- Parameters:
ec
- The entity context to use for accessing the database.keyPrefix
- The prefix for the keys to search for.- Returns:
- A list with all matching properties.
-
getByKeyPrefixAsMap
public Map<String,String> getByKeyPrefixAsMap(IEntityContext ec, String keyPrefix)
Description copied from interface:ISystemPropertyDao
Gets a map with all system properties that have a name starting with the given prefix. The map key is theproperty key
, the map value is theproperty value
.- Specified by:
getByKeyPrefixAsMap
in interfaceISystemPropertyDao
- Parameters:
ec
- The entity context to use for accessing the database.keyPrefix
- The prefix for the keys to search for.- Returns:
- A map with all matching properties.
-
getStringValue
public String getStringValue(IEntityContext ec, String key, String defaultValue)
Description copied from interface:ISystemPropertyDao
Returns the String value of the system property with the given key if it exists. If the system property does not exist, the provided default value will be returned.- Specified by:
getStringValue
in interfaceISystemPropertyDao
- Parameters:
ec
- entity context for database transactions.key
- of the system property.defaultValue
- to return if no system property was found for the given key.- Returns:
- the String value of the system property with the given key if it exists and the provided default value otherwise.
-
createProperty
public SystemProperty createProperty(IEntityContext ec, String key, String value)
- Specified by:
createProperty
in interfaceISystemPropertyDao
-
updateProperty
public SystemProperty updateProperty(IEntityContext ec, String key, String value)
- Specified by:
updateProperty
in interfaceISystemPropertyDao
-
updateProperties
public void updateProperties(IEntityContext ec, Map<String,String> properties)
Description copied from interface:ISystemPropertyDao
Writes all given properties to the database. The map key is theproperty key
, the map value is theproperty value
. If a property exists already, its value is overwritten. If a property does not exist, it is created.- Specified by:
updateProperties
in interfaceISystemPropertyDao
- Parameters:
ec
- The entity context to use for accessing the database.properties
- The properties to write to the database.
-
deleteProperty
public void deleteProperty(IEntityContext ec, String key)
- Specified by:
deleteProperty
in interfaceISystemPropertyDao
-
getDefaultSystemFormTheme
public FormThemeReference getDefaultSystemFormTheme(IEntityContext ec)
Description copied from interface:ISystemPropertyDao
Gets the form theme that was configured as the default theme for the entire system. When no theme was configured, returns an appropriate default theme.- Specified by:
getDefaultSystemFormTheme
in interfaceISystemPropertyDao
- Parameters:
ec
- The entity context to use for accessing the database.- Returns:
- The default form theme for the system.
-
-