|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.persistence.xml.JPersistenceUnitInfo
public class JPersistenceUnitInfo
Implementation of the PersistenceUnitInfo interface. It is given to the persistence provider to create entity managers.
Field Summary | |
---|---|
private java.lang.ClassLoader |
classLoader
ClassLoader that the provider may use to load any classes, resources, or open URLs. |
private boolean |
excludeUnlistedClasses
Whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes. |
private java.util.List<java.net.URL> |
jarFiles
The list of JAR file URLs that the persistence provider must look in to find the entity classes that must be managed by EntityManagers of this name. |
private javax.sql.DataSource |
jtaDataSource
JTA-enabled data source. |
private java.lang.String |
jtaDataSourceName
JTA-enabled data source name. |
private java.util.List<java.lang.String> |
managedClassNames
The list of the names of the classes that the persistence provider must add it to its set of managed classes. |
private java.util.List<java.lang.String> |
mappingFileNames
The list of mapping file names that the persistence provider must load to determine the mappings for the entity classes. |
private javax.sql.DataSource |
nonJtaDataSource
The non-JTA-enabled data source. |
private java.lang.String |
nonJtaDataSourceName
The non-JTA-enabled data source name. |
private PersistenceProvider |
persistenceProvider
Persistence provider (instantiated object). |
private java.lang.String |
persistenceProviderClassName
Persistence provider implementation class name. |
private java.lang.String |
persistenceUnitName
Name of the persistence unit. |
private java.net.URL |
persistenceUnitRootUrl
URL for the jar file or directory that is the root of the persistence unit. |
private java.net.URL |
persistenceXmlFileUrl
URL object that points to the persistence.xml file. |
private java.util.Properties |
properties
Properties object that may contain vendor-specific properties contained in the persistence.xml file. |
private PersistenceUnitTransactionType |
transactionType
Transaction type of the entity managers created by the EntityManagerFactory. |
Constructor Summary | |
---|---|
JPersistenceUnitInfo()
Default constructor. |
Method Summary | |
---|---|
void |
addClass(java.lang.String className)
Adds a class that the persistence provider must add it to its set of managed classes. |
void |
addJarFile(java.net.URL jarFile)
Adds a jar file to the list of JAR file URLs that the persistence provider must look in to find the entity classes that must be managed by EntityManagers of this name. |
void |
addMappingFileName(java.lang.String mappingFileName)
Adds a filename to the list of mapping file names. |
void |
addTransformer(ClassTransformer transformer)
Add a transformer supplied by the provider that will be called for every new class definition or class redefinition that gets loaded by the loader returned by the PersistenceInfo.getClassLoader method. |
boolean |
excludeUnlistedClasses()
|
java.lang.ClassLoader |
getClassLoader()
|
java.util.List<java.net.URL> |
getJarFiles()
|
java.util.List<java.net.URL> |
getJarFileUrls()
|
javax.sql.DataSource |
getJtaDataSource()
|
java.lang.String |
getJtaDataSourceName()
Gets the jta datasource name. |
java.util.List<java.lang.String> |
getManagedClassNames()
|
java.util.List<java.lang.String> |
getMappingFileNames()
|
java.lang.ClassLoader |
getNewTempClassLoader()
Return a new instance of a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs. |
javax.sql.DataSource |
getNonJtaDataSource()
|
java.lang.String |
getNonJtaDataSourceName()
Gets the non jta datasource name. |
PersistenceProvider |
getPersistenceProvider()
|
java.lang.String |
getPersistenceProviderClassName()
|
java.lang.String |
getPersistenceUnitName()
|
java.net.URL |
getPersistenceUnitRootUrl()
|
java.net.URL |
getPersistenceXmlFileUrl()
|
java.util.Properties |
getProperties()
|
PersistenceUnitTransactionType |
getTransactionType()
|
void |
setClassLoader(java.lang.ClassLoader classLoader)
Sets the classloader. |
void |
setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
Sets the boolean defining if the persistence unit that have not been explicitly listed are to be included in the set of managed classes. |
void |
setJtaDataSource(javax.sql.DataSource jtaDataSource)
Sets the JTA-enabled data source. |
void |
setJtaDataSourceName(java.lang.String jtaDataSourceName)
Sets the JTA-enabled data source name. |
void |
setNonJtaDataSource(javax.sql.DataSource nonJtaDataSource)
Sets the non-JTA-enabled data source. |
void |
setNonJtaDataSourceName(java.lang.String nonJtaDataSourceName)
Sets the non-JTA-enabled data source name. |
void |
setPersistenceProvider(PersistenceProvider persistenceProvider)
Sets the persistence provider object. |
void |
setPersistenceProviderClassName(java.lang.String persistenceProviderClassName)
Sets the persistence provider implementation class name. |
void |
setPersistenceUnitName(java.lang.String persistenceUnitName)
Sets the name of the persistence unit. |
void |
setPersistenceUnitRootUrl(java.net.URL persistenceUnitRootUrl)
Sets the URL for the jar file or directory that is the root of the persistence unit. |
void |
setPersistenceXmlFileUrl(java.net.URL persistenceXmlFileUrl)
Sets the URL object that points to the persistence.xml file. |
void |
setProperties(java.util.Properties properties)
Sets the properties use by this unit. |
void |
setTransactionType(PersistenceUnitTransactionType transactionType)
Sets the transaction type of the entity managers created by the EntityManagerFactory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String persistenceUnitName
private java.lang.String persistenceProviderClassName
private PersistenceUnitTransactionType transactionType
private javax.sql.DataSource jtaDataSource
private javax.sql.DataSource nonJtaDataSource
private java.lang.String jtaDataSourceName
private java.lang.String nonJtaDataSourceName
private java.util.List<java.lang.String> mappingFileNames
private java.util.List<java.net.URL> jarFiles
private java.net.URL persistenceUnitRootUrl
private java.util.List<java.lang.String> managedClassNames
private boolean excludeUnlistedClasses
private java.util.Properties properties
private java.lang.ClassLoader classLoader
private java.net.URL persistenceXmlFileUrl
private PersistenceProvider persistenceProvider
Constructor Detail |
---|
public JPersistenceUnitInfo()
Method Detail |
---|
public void setClassLoader(java.lang.ClassLoader classLoader)
classLoader
- that the provider may use to load any classes,
resources, or open URLs.public void setPersistenceUnitName(java.lang.String persistenceUnitName)
persistenceUnitName
- the given namepublic java.lang.String getPersistenceUnitName()
getPersistenceUnitName
in interface PersistenceUnitInfo
public void addJarFile(java.net.URL jarFile)
jarFile
- URL of the jar filepublic void setJtaDataSource(javax.sql.DataSource jtaDataSource)
jtaDataSource
- given datasource.public void setNonJtaDataSource(javax.sql.DataSource nonJtaDataSource)
nonJtaDataSource
- given datasource.public void setJtaDataSourceName(java.lang.String jtaDataSourceName)
jtaDataSourceName
- given name.public void setNonJtaDataSourceName(java.lang.String nonJtaDataSourceName)
nonJtaDataSourceName
- given name.public void addMappingFileName(java.lang.String mappingFileName)
mappingFileName
- name of the mapping file to add.public void setPersistenceProviderClassName(java.lang.String persistenceProviderClassName)
persistenceProviderClassName
- name of the class.public void setPersistenceProvider(PersistenceProvider persistenceProvider)
persistenceProvider
- the persistence provider object used.public void setPersistenceXmlFileUrl(java.net.URL persistenceXmlFileUrl)
persistenceXmlFileUrl
- URL pointing to persistence.xml filepublic void setProperties(java.util.Properties properties)
properties
- object with key/value.public java.lang.String getPersistenceProviderClassName()
getPersistenceProviderClassName
in interface PersistenceUnitInfo
public PersistenceProvider getPersistenceProvider()
public javax.sql.DataSource getJtaDataSource()
getJtaDataSource
in interface PersistenceUnitInfo
public javax.sql.DataSource getNonJtaDataSource()
getNonJtaDataSource
in interface PersistenceUnitInfo
public java.util.List<java.lang.String> getMappingFileNames()
getMappingFileNames
in interface PersistenceUnitInfo
public java.util.List<java.net.URL> getJarFiles()
public java.util.Properties getProperties()
getProperties
in interface PersistenceUnitInfo
public java.lang.ClassLoader getClassLoader()
getClassLoader
in interface PersistenceUnitInfo
public java.net.URL getPersistenceXmlFileUrl()
public java.lang.String getJtaDataSourceName()
public java.lang.String getNonJtaDataSourceName()
public PersistenceUnitTransactionType getTransactionType()
getTransactionType
in interface PersistenceUnitInfo
public void setTransactionType(PersistenceUnitTransactionType transactionType)
transactionType
- The transaction type corresponds to the
transaction-type attribute in the persistence.xml file.public java.util.List<java.net.URL> getJarFileUrls()
getJarFileUrls
in interface PersistenceUnitInfo
public void setPersistenceUnitRootUrl(java.net.URL persistenceUnitRootUrl)
persistenceUnitRootUrl
- root url of persistence unitpublic java.net.URL getPersistenceUnitRootUrl()
getPersistenceUnitRootUrl
in interface PersistenceUnitInfo
public void addClass(java.lang.String className)
className
- name of the classpublic java.util.List<java.lang.String> getManagedClassNames()
getManagedClassNames
in interface PersistenceUnitInfo
public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
excludeUnlistedClasses
- true/falsepublic boolean excludeUnlistedClasses()
excludeUnlistedClasses
in interface PersistenceUnitInfo
public void addTransformer(ClassTransformer transformer)
addTransformer
in interface PersistenceUnitInfo
transformer
- A provider-supplied transformer that the Container
invokes at class-(re)definition timepublic java.lang.ClassLoader getNewTempClassLoader()
getNewTempClassLoader
in interface PersistenceUnitInfo
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |