Class SEPersistenceUnitInfo
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.deployment.SEPersistenceUnitInfo
-
- All Implemented Interfaces:
javax.persistence.spi.PersistenceUnitInfo
public class SEPersistenceUnitInfo extends java.lang.Object implements javax.persistence.spi.PersistenceUnitInfoInternal implementation of the PersistenceUnitInfo detailed in the EJB 3.0 specification Used by our Java SE implementation so common method calls can be used in setting of Container and non-Container EntityManagerFactories.
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.persistence.SharedCacheModecacheModeprotected booleanexcludeUnlistedClassesprotected java.util.List<java.net.URL>jarFileUrlsprotected javax.sql.DataSourcejtaDataSourceprotected java.util.List<java.lang.String>managedClassNamesprotected java.util.List<java.lang.String>mappingFilesprotected javax.sql.DataSourcenonJtaDataSourceprotected java.lang.StringpersistenceProviderClassNameprotected java.lang.StringpersistenceUnitNameprotected java.util.List<SEPersistenceUnitProperty>persistenceUnitPropertiesprotected java.net.URLpersistenceUnitRootUrlprotected javax.persistence.spi.PersistenceUnitTransactionTypepersistenceUnitTransactionTypeprotected java.util.Propertiespropertiesprotected java.lang.ClassLoaderrealClassLoaderprotected java.lang.ClassLoadertempClassLoaderprotected javax.persistence.ValidationModevalidationMode
-
Constructor Summary
Constructors Constructor Description SEPersistenceUnitInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransformer(javax.persistence.spi.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 PersistenceUnitInfo.getClassLoader method.booleanexcludeUnlistedClasses()java.lang.ClassLoadergetClassLoader()java.util.Collection<java.lang.String>getJarFiles()java.util.List<java.net.URL>getJarFileUrls()javax.sql.DataSourcegetJtaDataSource()java.util.List<java.lang.String>getManagedClassNames()java.util.List<java.lang.String>getMappingFileNames()java.lang.ClassLoadergetNewTempClassLoader()Return a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs.javax.sql.DataSourcegetNonJtaDataSource()java.lang.StringgetPersistenceProviderClassName()java.lang.StringgetPersistenceUnitName()java.util.List<SEPersistenceUnitProperty>getPersistenceUnitProperties()Used with the OX mapping file for the Canonical model processor.java.net.URLgetPersistenceUnitRootUrl()java.lang.StringgetPersistenceXMLSchemaVersion()java.util.PropertiesgetProperties()javax.persistence.SharedCacheModegetSharedCacheMode()javax.persistence.spi.PersistenceUnitTransactionTypegetTransactionType()javax.persistence.ValidationModegetValidationMode()voidsetClassLoader(java.lang.ClassLoader loader)voidsetExcludeUnlistedClasses(boolean excludeUnlistedClasses)voidsetJarFileUrls(java.util.List<java.net.URL> jarFileUrls)voidsetJtaDataSource(javax.sql.DataSource jtaDataSource)voidsetManagedClassNames(java.util.List<java.lang.String> managedClassNames)voidsetMappingFileNames(java.util.List<java.lang.String> mappingFiles)voidsetNewTempClassLoader(java.lang.ClassLoader loader)voidsetNonJtaDataSource(javax.sql.DataSource nonJtaDataSource)voidsetPersistenceProviderClassName(java.lang.String persistenceProviderClassName)voidsetPersistenceUnitName(java.lang.String persistenceUnitName)voidsetPersistenceUnitProperties(java.util.List<SEPersistenceUnitProperty> persistenceUnitProperties)Used with the OX mapping file for the Canonical model processor.voidsetPersistenceUnitRootUrl(java.net.URL persistenceUnitRootUrl)voidsetProperties(java.util.Properties properties)voidsetSharedCacheMode(java.lang.String sharedCacheMode)voidsetTransactionType(javax.persistence.spi.PersistenceUnitTransactionType persistenceUnitTransactionType)voidsetValidationMode(java.lang.String validationMode)
-
-
-
Field Detail
-
cacheMode
protected javax.persistence.SharedCacheMode cacheMode
-
validationMode
protected javax.persistence.ValidationMode validationMode
-
persistenceUnitName
protected java.lang.String persistenceUnitName
-
persistenceProviderClassName
protected java.lang.String persistenceProviderClassName
-
jtaDataSource
protected javax.sql.DataSource jtaDataSource
-
nonJtaDataSource
protected javax.sql.DataSource nonJtaDataSource
-
persistenceUnitTransactionType
protected javax.persistence.spi.PersistenceUnitTransactionType persistenceUnitTransactionType
-
mappingFiles
protected java.util.List<java.lang.String> mappingFiles
-
jarFileUrls
protected java.util.List<java.net.URL> jarFileUrls
-
managedClassNames
protected java.util.List<java.lang.String> managedClassNames
-
persistenceUnitRootUrl
protected java.net.URL persistenceUnitRootUrl
-
excludeUnlistedClasses
protected boolean excludeUnlistedClasses
-
persistenceUnitProperties
protected java.util.List<SEPersistenceUnitProperty> persistenceUnitProperties
-
properties
protected java.util.Properties properties
-
tempClassLoader
protected java.lang.ClassLoader tempClassLoader
-
realClassLoader
protected java.lang.ClassLoader realClassLoader
-
-
Method Detail
-
getPersistenceUnitName
public java.lang.String getPersistenceUnitName()
- Specified by:
getPersistenceUnitNamein interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- The name of the persistence unit. Corresponds to the <name> element in the persistence.xml file.
-
setPersistenceUnitName
public void setPersistenceUnitName(java.lang.String persistenceUnitName)
-
getPersistenceUnitProperties
public java.util.List<SEPersistenceUnitProperty> getPersistenceUnitProperties()
Used with the OX mapping file for the Canonical model processor.
-
setPersistenceUnitProperties
public void setPersistenceUnitProperties(java.util.List<SEPersistenceUnitProperty> persistenceUnitProperties)
Used with the OX mapping file for the Canonical model processor.
-
getPersistenceProviderClassName
public java.lang.String getPersistenceProviderClassName()
- Specified by:
getPersistenceProviderClassNamein interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- The fully qualified name of the persistence provider implementation class. Corresponds to the <provider> element in the persistence.xml file.
-
setPersistenceProviderClassName
public void setPersistenceProviderClassName(java.lang.String persistenceProviderClassName)
-
getTransactionType
public javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()
- Specified by:
getTransactionTypein interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- The transaction type of the entity managers created by the EntityManagerFactory. The transaction type corresponds to the transaction-type attribute in the persistence.xml file.
-
setTransactionType
public void setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType persistenceUnitTransactionType)
-
getJtaDataSource
public javax.sql.DataSource getJtaDataSource()
- Specified by:
getJtaDataSourcein interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- the JTA-enabled data source to be used by the persistence provider. The data source corresponds to the <jta-data-source> element in the persistence.xml file or is provided at deployment or by the container.
-
setJtaDataSource
public void setJtaDataSource(javax.sql.DataSource jtaDataSource)
-
getNonJtaDataSource
public javax.sql.DataSource getNonJtaDataSource()
- Specified by:
getNonJtaDataSourcein interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- The non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. The data source corresponds to the named <non-jta-data-source> element in the persistence.xml file or provided at deployment or by the container.
-
setNonJtaDataSource
public void setNonJtaDataSource(javax.sql.DataSource nonJtaDataSource)
-
getMappingFileNames
public java.util.List<java.lang.String> getMappingFileNames()
- Specified by:
getMappingFileNamesin interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- The list of mapping file names that the persistence provider must load to determine the mappings for the entity classes. The mapping files must be in the standard XML mapping format, be uniquely named and be resource-loadable from the application classpath. This list will not include the orm.xml file if one was specified. Each mapping file name corresponds to a <mapping-file> element in the persistence.xml file.
-
setMappingFileNames
public void setMappingFileNames(java.util.List<java.lang.String> mappingFiles)
-
getJarFileUrls
public java.util.List<java.net.URL> getJarFileUrls()
- Specified by:
getJarFileUrlsin interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- The list of JAR file URLs that the persistence provider must examine for managed classes of the persistence unit. Each jar file URL corresponds to a named <jar-file> element in the persistence.xml file.
-
setJarFileUrls
public void setJarFileUrls(java.util.List<java.net.URL> jarFileUrls)
-
getPersistenceUnitRootUrl
public java.net.URL getPersistenceUnitRootUrl()
- Specified by:
getPersistenceUnitRootUrlin interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- The URL for the jar file that is the root of the persistence unit. If the persistence unit is rooted in the WEB-INF/classes directory, this will be the URL of that directory.
-
setPersistenceUnitRootUrl
public void setPersistenceUnitRootUrl(java.net.URL persistenceUnitRootUrl)
-
getManagedClassNames
public java.util.List<java.lang.String> getManagedClassNames()
- Specified by:
getManagedClassNamesin interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- The list of the names of the classes that the persistence provider must add it to its set of managed classes. Each name corresponds to a named <class> element in the persistence.xml file.
-
setManagedClassNames
public void setManagedClassNames(java.util.List<java.lang.String> managedClassNames)
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()
- Specified by:
excludeUnlistedClassesin interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- 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. This value corresponds to the <exclude-unlisted-classes> element in the persistence.xml file.
-
setExcludeUnlistedClasses
public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
-
getProperties
public java.util.Properties getProperties()
- Specified by:
getPropertiesin interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- Properties object. Each property corresponds to a <property> element in the persistence.xml file
-
setProperties
public void setProperties(java.util.Properties properties)
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
- Specified by:
getClassLoaderin interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- ClassLoader that the provider may use to load any classes, resources, or open URLs.
-
addTransformer
public void addTransformer(javax.persistence.spi.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 PersistenceUnitInfo.getClassLoader method. The transformer has no effect on the result returned by the PersistenceUnitInfo.getNewTempClassLoader method. Classes are only transformed once within the same classloading scope, regardless of how many persistence units they may be a part of.- Specified by:
addTransformerin interfacejavax.persistence.spi.PersistenceUnitInfo- Parameters:
transformer- A provider-supplied transformer that the Container invokes at class-(re)definition time
-
getNewTempClassLoader
public java.lang.ClassLoader getNewTempClassLoader()
Return a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs. The scope and classpath of this loader is exactly the same as that of the loader returned by PersistenceUnitInfo.getClassLoader. None of the classes loaded by this class loader will be visible to application components.- Specified by:
getNewTempClassLoaderin interfacejavax.persistence.spi.PersistenceUnitInfo- Returns:
- Temporary ClassLoader with same visibility as current loader
-
setNewTempClassLoader
public void setNewTempClassLoader(java.lang.ClassLoader loader)
-
setSharedCacheMode
public void setSharedCacheMode(java.lang.String sharedCacheMode)
- Since:
- Java Persistence 2.0
- See Also:
PersistenceUnitInfo.getSharedCacheMode()
-
setValidationMode
public void setValidationMode(java.lang.String validationMode)
- Since:
- Java Persistence 2.0
- See Also:
PersistenceUnitInfo.getValidationMode()
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader loader)
-
getJarFiles
public java.util.Collection<java.lang.String> getJarFiles()
-
getPersistenceXMLSchemaVersion
public java.lang.String getPersistenceXMLSchemaVersion()
- Specified by:
getPersistenceXMLSchemaVersionin interfacejavax.persistence.spi.PersistenceUnitInfo- Since:
- Java Persistence 2.0
- See Also:
PersistenceUnitInfo.getPersistenceXMLSchemaVersion()
-
getSharedCacheMode
public javax.persistence.SharedCacheMode getSharedCacheMode()
- Specified by:
getSharedCacheModein interfacejavax.persistence.spi.PersistenceUnitInfo- Since:
- Java Persistence 2.0
- See Also:
PersistenceUnitInfo.getSharedCacheMode()
-
getValidationMode
public javax.persistence.ValidationMode getValidationMode()
- Specified by:
getValidationModein interfacejavax.persistence.spi.PersistenceUnitInfo- Since:
- Java Persistence 2.0
- See Also:
PersistenceUnitInfo.getValidationMode()
-
-