public class CmsPersistenceUnitConfiguration
extends java.lang.Object
This class allow to be managed (reading and writing) JPA persistence.xml configuration file.
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
ATTR_CONNECTION_PROPERTIES
Attribute name for connection settings for Apache OpenJPA & DBCP.
|
static java.lang.String |
ATTR_GENERATE_SCHEMA
Attribute name for connection settings.
|
static java.lang.String |
ATTR_GENERATE_SCHEMA_VALUE
Attribute name for connection settings.
|
static java.lang.String |
ATTR_NAME
Attribute name for attribute "name" of property.
|
static java.lang.String |
ATTR_VALUE
Attribute name for attribute "value" of property.
|
static java.lang.String |
TAG_PERSISTENCE_UNIT
Tag constant.
|
static java.lang.String |
TAG_PROPERTIES
Tag constant.
|
static java.lang.String |
TAG_PROPERTY
Tag constant.
|
构造器和说明 |
---|
CmsPersistenceUnitConfiguration(java.lang.String unitName,
java.lang.String fileName)
Public constructor which initialize the object.
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getPropertyValue(java.lang.String name,
java.lang.String defaultValue)
Returns a property value for the given property name.
|
void |
removeProperty(java.lang.String name)
Removes property with given name.
|
void |
save()
Saves the original configuration file.
|
void |
setPropertyValue(java.lang.String name,
java.lang.String value)
Sets property value with given name and value.
|
public static final java.lang.String ATTR_CONNECTION_PROPERTIES
public static final java.lang.String ATTR_GENERATE_SCHEMA
public static final java.lang.String ATTR_GENERATE_SCHEMA_VALUE
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_VALUE
public static final java.lang.String TAG_PERSISTENCE_UNIT
public static final java.lang.String TAG_PROPERTIES
public static final java.lang.String TAG_PROPERTY
public CmsPersistenceUnitConfiguration(java.lang.String unitName, java.lang.String fileName)
unitName
- persistence unit name to be managedfileName
- configuration file namepublic java.lang.String getPropertyValue(java.lang.String name, java.lang.String defaultValue)
name
- the name of the propertydefaultValue
- the default value if there was no property configured with the given namepublic void removeProperty(java.lang.String name)
name
- value of the name attributepublic void save()
public void setPropertyValue(java.lang.String name, java.lang.String value)
name
- value of the name attributevalue
- value of the value attribute