com.caucho.env.jpa
Class PersistenceUnitManager

java.lang.Object
  extended by com.caucho.env.jpa.PersistenceUnitManager
All Implemented Interfaces:
PersistenceUnitInfo

public class PersistenceUnitManager
extends java.lang.Object
implements PersistenceUnitInfo

Manages a single persistence unit


Nested Class Summary
 class PersistenceUnitManager.PropertiesConfig
           
static class PersistenceUnitManager.PropertyConfig
           
static class PersistenceUnitManager.TransformerAdapter
           
 
Method Summary
 void addClass(java.lang.String className)
           
 void addJarFile(java.lang.String jarFile)
           
 void addMappingFile(java.lang.String fileName)
           
 void addTransformer(ClassTransformer transformer)
          Adds a class transformer.
 PersistenceUnitManager.PropertiesConfig createProperties()
           
 boolean excludeUnlistedClasses()
          Returns true if only listed classes are allowed.
 java.lang.ClassLoader getClassLoader()
          Returns the classloader the provider should use to load classes, resources or URLs.
 EntityManagerFactory getEntityManagerFactoryDelegate()
          Create or return the provider's EntityManagerFactory
 java.util.List<java.net.URL> getJarFileUrls()
          Returns the list of jars for the managed classes.
 javax.sql.DataSource getJtaDataSource()
          Returns the jta-enabled data source.
 java.util.List<java.lang.String> getManagedClassNames()
          Returns the list of managed classes.
 java.util.List<java.lang.String> getMappingFileNames()
          Returns the mapping file names.
 java.lang.String getName()
           
 java.lang.ClassLoader getNewTempClassLoader()
          Returns a temporary class loader.
 javax.sql.DataSource getNonJtaDataSource()
          Returns the non-jta-enabled data source.
 java.lang.String getPersistenceProviderClassName()
          Returns the full class name of the persistence provider.
 java.lang.String getPersistenceUnitName()
          Returns the name.
 java.net.URL getPersistenceUnitRootUrl()
          Returns the root persistence unit.
 java.lang.String getPersistenceXMLSchemaVersion()
           
 java.util.Properties getProperties()
          Returns a properties object.
 java.lang.Class<?> getProvider()
           
 java.net.URL getRoot()
          The root URL of the persistence .jar or classes directory.
 SharedCacheMode getSharedCacheMode()
           
 PersistenceUnitTransactionType getTransactionType()
          Returns the transaction handling.
 ValidationMode getValidationMode()
           
 void setConfigLocation(java.lang.String location)
           
 void setDescription(java.lang.String description)
           
 void setExcludeUnlistedClasses(boolean isExclude)
           
 void setJtaDataSource(java.lang.String name)
           
 void setJtaDataSourceValue(javax.sql.DataSource dataSource)
           
 void setNonJtaDataSource(java.lang.String name)
           
 void setNonJtaDataSourceValue(javax.sql.DataSource dataSource)
           
 void setProvider(java.lang.Class<PersistenceProvider> cl)
           
 void setRoot(java.net.URL url)
          The root URL of the persistence .jar or classes directory.
 void setSharedCacheMode(java.lang.String mode)
           
 void setValidationMode(java.lang.String mode)
           
 void setVersion(java.lang.String version)
          Sets the schema version.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()

setConfigLocation

public void setConfigLocation(java.lang.String location)

setVersion

public void setVersion(java.lang.String version)
Sets the schema version.


getRoot

public java.net.URL getRoot()
The root URL of the persistence .jar or classes directory.


setRoot

public void setRoot(java.net.URL url)
The root URL of the persistence .jar or classes directory.


setDescription

public void setDescription(java.lang.String description)

getProvider

public java.lang.Class<?> getProvider()

setProvider

public void setProvider(java.lang.Class<PersistenceProvider> cl)

addClass

public void addClass(java.lang.String className)

setExcludeUnlistedClasses

public void setExcludeUnlistedClasses(boolean isExclude)

addMappingFile

public void addMappingFile(java.lang.String fileName)

addJarFile

public void addJarFile(java.lang.String jarFile)

setSharedCacheMode

public void setSharedCacheMode(java.lang.String mode)

setValidationMode

public void setValidationMode(java.lang.String mode)

setJtaDataSource

public void setJtaDataSource(java.lang.String name)

setJtaDataSourceValue

public void setJtaDataSourceValue(javax.sql.DataSource dataSource)

setNonJtaDataSource

public void setNonJtaDataSource(java.lang.String name)

setNonJtaDataSourceValue

public void setNonJtaDataSourceValue(javax.sql.DataSource dataSource)

createProperties

public PersistenceUnitManager.PropertiesConfig createProperties()

getEntityManagerFactoryDelegate

public EntityManagerFactory getEntityManagerFactoryDelegate()
Create or return the provider's EntityManagerFactory


getPersistenceUnitName

public java.lang.String getPersistenceUnitName()
Description copied from interface: PersistenceUnitInfo
Returns the name.

Specified by:
getPersistenceUnitName in interface PersistenceUnitInfo

getPersistenceXMLSchemaVersion

public java.lang.String getPersistenceXMLSchemaVersion()
Specified by:
getPersistenceXMLSchemaVersion in interface PersistenceUnitInfo

getPersistenceUnitRootUrl

public java.net.URL getPersistenceUnitRootUrl()
Description copied from interface: PersistenceUnitInfo
Returns the root persistence unit.

Specified by:
getPersistenceUnitRootUrl in interface PersistenceUnitInfo

getPersistenceProviderClassName

public java.lang.String getPersistenceProviderClassName()
Description copied from interface: PersistenceUnitInfo
Returns the full class name of the persistence provider.

Specified by:
getPersistenceProviderClassName in interface PersistenceUnitInfo

getClassLoader

public java.lang.ClassLoader getClassLoader()
Description copied from interface: PersistenceUnitInfo
Returns the classloader the provider should use to load classes, resources or URLs.

Specified by:
getClassLoader in interface PersistenceUnitInfo

getManagedClassNames

public java.util.List<java.lang.String> getManagedClassNames()
Description copied from interface: PersistenceUnitInfo
Returns the list of managed classes.

Specified by:
getManagedClassNames in interface PersistenceUnitInfo

excludeUnlistedClasses

public boolean excludeUnlistedClasses()
Description copied from interface: PersistenceUnitInfo
Returns true if only listed classes are allowed.

Specified by:
excludeUnlistedClasses in interface PersistenceUnitInfo

getJarFileUrls

public java.util.List<java.net.URL> getJarFileUrls()
Description copied from interface: PersistenceUnitInfo
Returns the list of jars for the managed classes.

Specified by:
getJarFileUrls in interface PersistenceUnitInfo

getMappingFileNames

public java.util.List<java.lang.String> getMappingFileNames()
Description copied from interface: PersistenceUnitInfo
Returns the mapping file names. The files are resource-loadable from the classpath.

Specified by:
getMappingFileNames in interface PersistenceUnitInfo

getSharedCacheMode

public SharedCacheMode getSharedCacheMode()
Specified by:
getSharedCacheMode in interface PersistenceUnitInfo

getTransactionType

public PersistenceUnitTransactionType getTransactionType()
Description copied from interface: PersistenceUnitInfo
Returns the transaction handling.

Specified by:
getTransactionType in interface PersistenceUnitInfo

getValidationMode

public ValidationMode getValidationMode()
Specified by:
getValidationMode in interface PersistenceUnitInfo

getJtaDataSource

public javax.sql.DataSource getJtaDataSource()
Description copied from interface: PersistenceUnitInfo
Returns the jta-enabled data source.

Specified by:
getJtaDataSource in interface PersistenceUnitInfo

getNonJtaDataSource

public javax.sql.DataSource getNonJtaDataSource()
Description copied from interface: PersistenceUnitInfo
Returns the non-jta-enabled data source.

Specified by:
getNonJtaDataSource in interface PersistenceUnitInfo

getProperties

public java.util.Properties getProperties()
Description copied from interface: PersistenceUnitInfo
Returns a properties object.

Specified by:
getProperties in interface PersistenceUnitInfo

addTransformer

public void addTransformer(ClassTransformer transformer)
Adds a class transformer.

Specified by:
addTransformer in interface PersistenceUnitInfo

getNewTempClassLoader

public java.lang.ClassLoader getNewTempClassLoader()
Returns a temporary class loader.

Specified by:
getNewTempClassLoader in interface PersistenceUnitInfo

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object