public class PersistenceUnit extends Object implements IPersistenceUnit
| Constructor and Description |
|---|
PersistenceUnit() |
PersistenceUnit(IPersistenceUnit iSource) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEntity(String sEntity)
add class name of an entity to these unit.
|
boolean |
getBooleanProperty(String sProperty) |
boolean |
getBooleanProperty(String sProperty,
boolean bDefault) |
List<String> |
getEntities() |
String |
getMappFile() |
String |
getName() |
String |
getPassword() |
Set<String> |
getPropertNames() |
String |
getProperty(String sProperty) |
String |
getProvider() |
String |
getUser() |
static List<String> |
listUnits() |
static PersistenceUnit |
loadUnit(String sName)
load the specified persistence unit from the (hopefully existing)
persistence.xml ... create a suitable persistence unit object and return
those object.
|
void |
merge(IPersistenceUnit iPU) |
void |
setMappFile(String sFile) |
void |
setName(String sName)
set name for these persistence unit.
|
void |
setPassword(String sPassword) |
void |
setProperty(String sProperty,
String sValue)
set new property for these unit.
|
void |
setProvider(String sProvider)
set class name of provider implementation.
|
void |
setUser(String sUser) |
String |
toString() |
public PersistenceUnit()
public PersistenceUnit(IPersistenceUnit iSource) throws Exception
Exceptionpublic void merge(IPersistenceUnit iPU) throws Exception
Exceptionpublic static PersistenceUnit loadUnit(String sName) throws Exception
sName - [IN]
name of the persistence unit to be loaded here.Exception - if specified persistence unit does not exists
or couldn't be loaded successfully.public static List<String> listUnits() throws Exception
Exceptionpublic void setName(String sName) throws Exception
sName - [IN]
new name for these unit.
Must not be empty or null !Exception - in case unit name is invalid.public String getName() throws Exception
getName in interface IPersistenceUnitExceptionpublic void setProvider(String sProvider) throws Exception
sProvider - class name of provider impl.Exceptionpublic String getProvider() throws Exception
getProvider in interface IPersistenceUnitExceptionpublic String getUser() throws Exception
getUser in interface IPersistenceUnitExceptionpublic String getPassword() throws Exception
getPassword in interface IPersistenceUnitExceptionpublic void addEntity(String sEntity) throws Exception
sEntity - class name of a new entity.Exceptionpublic List<String> getEntities() throws Exception
getEntities in interface IPersistenceUnitExceptionpublic void setProperty(String sProperty, String sValue) throws Exception
sProperty - sValue - Exceptionpublic String getProperty(String sProperty) throws Exception
getProperty in interface IPersistenceUnitExceptionpublic boolean getBooleanProperty(String sProperty) throws Exception
getBooleanProperty in interface IPersistenceUnitExceptionpublic boolean getBooleanProperty(String sProperty, boolean bDefault) throws Exception
Exceptionpublic Set<String> getPropertNames() throws Exception
getPropertNames in interface IPersistenceUnitExceptionCopyright © 2016 as-development.net. All rights reserved.