Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.deployment

public Class SEPersistenceUnitInfo

extends Object
implements PersistenceUnitInfo
Class Inheritance
All Implemented Interfaces
jakarta.persistence.spi.PersistenceUnitInfo
Imports
java.net.MalformedURLException, .URL, java.util.ArrayList, .Collection, .Collections, .List, .Properties, jakarta.persistence.PersistenceException, .SharedCacheMode, .ValidationMode, jakarta.persistence.spi.ClassTransformer, .PersistenceUnitInfo, .PersistenceUnitTransactionType, javax.sql.DataSource

Internal 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

Modifier and TypeField and Description
protected SharedCacheMode
protected boolean
private Collection<String>
protected List<URL>
protected DataSource
protected List<String>
protected List<String>
protected DataSource
protected String
protected String
protected List<SEPersistenceUnitProperty>
protected URL
protected PersistenceUnitTransactionType
protected Properties
protected ClassLoader
protected ClassLoader
protected ValidationMode

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addTransformer(ClassTransformer
A provider-supplied transformer that the Container invokes at class-(re)definition time
transformer
)

Implements jakarta.persistence.spi.PersistenceUnitInfo.addTransformer.

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.
public boolean

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.
excludeUnlistedClasses
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.excludeUnlistedClasses.

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.
public ClassLoader

Returns:

ClassLoader that the provider may use to load any classes, resources, or open URLs.
getClassLoader
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getClassLoader.

Returns ClassLoader that the provider may use to load any classes, resources, or open URLs.
public Collection<String>
public List<URL>

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.
getJarFileUrls
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getJarFileUrls.

Returns a list of URLs for the jar files or exploded jar file directories that the persistence provider must examine for managed classes of the persistence unit.
public DataSource

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.
getJtaDataSource
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getJtaDataSource.

Returns the JTA-enabled data source to be used by the persistence provider.
public List<String>

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.
getManagedClassNames
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getManagedClassNames.

Returns the list of the names of the classes that the persistence provider must add to its set of managed classes.
public List<String>

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.
getMappingFileNames
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getMappingFileNames.

Returns the list of the names of the mapping files that the persistence provider must load to determine the mappings for the entity classes.
public ClassLoader

Returns:

Temporary ClassLoader with same visibility as current loader
getNewTempClassLoader
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getNewTempClassLoader.

Return a ClassLoader that the provider may use to temporarily load any classes, resources, or open URLs.
public DataSource

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.
getNonJtaDataSource
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getNonJtaDataSource.

Returns the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction.
public String

Returns:

The fully qualified name of the persistence provider implementation class. Corresponds to the <provider> element in the persistence.xml file.
getPersistenceProviderClassName
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceProviderClassName.

Returns the fully qualified name of the persistence provider implementation class.
public String

Returns:

The name of the persistence unit. Corresponds to the <name> element in the persistence.xml file.
getPersistenceUnitName
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceUnitName.

Returns the name of the persistence unit.
public List<SEPersistenceUnitProperty>
getPersistenceUnitProperties()

Used with the OX mapping file for the Canonical model processor.

public URL

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.
getPersistenceUnitRootUrl
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceUnitRootUrl.

Returns the URL for the jar file or directory that is the root of the persistence unit.
public String
getPersistenceXMLSchemaVersion()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceXMLSchemaVersion.

Returns the schema version of the persistence.xml file.
public Properties

Returns:

Properties object. Each property corresponds to a <property> element in the persistence.xml file
getProperties
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getProperties.

Returns a properties object.
public SharedCacheMode
getSharedCacheMode()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getSharedCacheMode.

Returns the specification of how the provider must use a second-level cache for the persistence unit.
public PersistenceUnitTransactionType

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.
getTransactionType
()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getTransactionType.

Returns the transaction type of the entity managers created by the EntityManagerFactory.
public ValidationMode
getValidationMode()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getValidationMode.

Returns the validation mode to be used by the persistence provider for the persistence unit.
public void
public void
setExcludeUnlistedClasses(boolean excludeUnlistedClasses)

public void
setJarFileUrls(List<URL> jarFileUrls)

public void
public void
setManagedClassNames(List<String> managedClassNames)

public void
public void
public void
setNonJtaDataSource(DataSource nonJtaDataSource)

public void
setPersistenceProviderClassName(String persistenceProviderClassName)

public void
setPersistenceUnitName(String persistenceUnitName)

public void
setPersistenceUnitProperties(List<SEPersistenceUnitProperty> persistenceUnitProperties)

Used with the OX mapping file for the Canonical model processor.

public void
setPersistenceUnitRootUrl(URL persistenceUnitRootUrl)

public void
public void
setSharedCacheMode(String sharedCacheMode)

public void
setTransactionType(PersistenceUnitTransactionType persistenceUnitTransactionType)

public void
setValidationMode(String validationMode)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheModeback to summary
protected SharedCacheMode cacheMode
excludeUnlistedClassesback to summary
protected boolean excludeUnlistedClasses
jarFilesback to summary
private Collection<String> jarFiles
jarFileUrlsback to summary
protected List<URL> jarFileUrls
jtaDataSourceback to summary
protected DataSource jtaDataSource
managedClassNamesback to summary
protected List<String> managedClassNames
mappingFilesback to summary
protected List<String> mappingFiles
nonJtaDataSourceback to summary
protected DataSource nonJtaDataSource
persistenceProviderClassNameback to summary
protected String persistenceProviderClassName
persistenceUnitNameback to summary
protected String persistenceUnitName
persistenceUnitPropertiesback to summary
protected List<SEPersistenceUnitProperty> persistenceUnitProperties
persistenceUnitRootUrlback to summary
protected URL persistenceUnitRootUrl
persistenceUnitTransactionTypeback to summary
protected PersistenceUnitTransactionType persistenceUnitTransactionType
propertiesback to summary
protected Properties properties
realClassLoaderback to summary
protected ClassLoader realClassLoader
tempClassLoaderback to summary
protected ClassLoader tempClassLoader
validationModeback to summary
protected ValidationMode validationMode

Constructor Detail

SEPersistenceUnitInfoback to summary
public SEPersistenceUnitInfo()

Method Detail

addTransformerback to summary
public void addTransformer(ClassTransformer transformer)

Implements jakarta.persistence.spi.PersistenceUnitInfo.addTransformer.

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.

Parameters
transformer:ClassTransformer

A provider-supplied transformer that the Container invokes at class-(re)definition time

Annotations
@Override
excludeUnlistedClassesback to summary
public boolean excludeUnlistedClasses()

Implements jakarta.persistence.spi.PersistenceUnitInfo.excludeUnlistedClasses.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.excludeUnlistedClasses.

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.

Returns:boolean

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.

Annotations
@Override
getClassLoaderback to summary
public ClassLoader getClassLoader()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getClassLoader.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getClassLoader.

Returns ClassLoader that the provider may use to load any classes, resources, or open URLs.

Returns:ClassLoader

ClassLoader that the provider may use to load any classes, resources, or open URLs.

Annotations
@Override
getJarFilesback to summary
public Collection<String> getJarFiles()
getJarFileUrlsback to summary
public List<URL> getJarFileUrls()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getJarFileUrls.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getJarFileUrls.

Returns a list of URLs for the jar files or exploded jar file directories that the persistence provider must examine for managed classes of the persistence unit. Each URL corresponds to a jar-file element in the persistence.xml file. A URL will either be a file: URL referring to a jar file or referring to a directory that contains an exploded jar file, or some other URL from which an InputStream in jar format can be obtained.

Returns:List<URL>

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.

Annotations
@Override
getJtaDataSourceback to summary
public DataSource getJtaDataSource()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getJtaDataSource.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getJtaDataSource.

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.

Returns:DataSource

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.

Annotations
@Override
getManagedClassNamesback to summary
public List<String> getManagedClassNames()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getManagedClassNames.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getManagedClassNames.

Returns the list of the names of the classes that the persistence provider must add to its set of managed classes. Each name corresponds to a named class element in the persistence.xml file.

Returns:List<String>

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.

Annotations
@Override
getMappingFileNamesback to summary
public List<String> getMappingFileNames()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getMappingFileNames.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getMappingFileNames.

Returns the list of the names of the mapping files 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. Each mapping file name corresponds to a mapping-file element in the persistence.xml file.

Returns:List<String>

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.

Annotations
@Override
getNewTempClassLoaderback to summary
public ClassLoader getNewTempClassLoader()

Implements jakarta.persistence.spi.PersistenceUnitInfo.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.

Returns:ClassLoader

Temporary ClassLoader with same visibility as current loader

Annotations
@Override
getNonJtaDataSourceback to summary
public DataSource getNonJtaDataSource()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getNonJtaDataSource.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getNonJtaDataSource.

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.

Returns:DataSource

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.

Annotations
@Override
getPersistenceProviderClassNameback to summary
public String getPersistenceProviderClassName()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceProviderClassName.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceProviderClassName.

Returns the fully qualified name of the persistence provider implementation class. Corresponds to the provider element in the persistence.xml file.

Returns:String

The fully qualified name of the persistence provider implementation class. Corresponds to the <provider> element in the persistence.xml file.

Annotations
@Override
getPersistenceUnitNameback to summary
public String getPersistenceUnitName()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceUnitName.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceUnitName.

Returns the name of the persistence unit. Corresponds to the name attribute in the persistence.xml file.

Returns:String

The name of the persistence unit. Corresponds to the <name> element in the persistence.xml file.

Annotations
@Override
getPersistenceUnitPropertiesback to summary
public List<SEPersistenceUnitProperty> getPersistenceUnitProperties()

Used with the OX mapping file for the Canonical model processor.

getPersistenceUnitRootUrlback to summary
public URL getPersistenceUnitRootUrl()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceUnitRootUrl.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceUnitRootUrl.

Returns the URL for the jar file or directory 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.) The URL will either be a file: URL referring to a jar file or referring to a directory that contains an exploded jar file, or some other URL from which an InputStream in jar format can be obtained.

Returns:URL

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.

Annotations
@Override
getPersistenceXMLSchemaVersionback to summary
public String getPersistenceXMLSchemaVersion()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceXMLSchemaVersion.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getPersistenceXMLSchemaVersion.

Returns the schema version of the persistence.xml file.

Returns:String

persistence.xml schema version

Annotations
@Override
Since
Java Persistence 2.0
See Also
PersistenceUnitInfo#getPersistenceXMLSchemaVersion()
getPropertiesback to summary
public Properties getProperties()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getProperties.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getProperties.

Returns a properties object. Each property corresponds to a property element in the persistence.xml file or to a property set by the container.

Returns:Properties

Properties object. Each property corresponds to a <property> element in the persistence.xml file

Annotations
@Override
getSharedCacheModeback to summary
public SharedCacheMode getSharedCacheMode()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getSharedCacheMode.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getSharedCacheMode.

Returns the specification of how the provider must use a second-level cache for the persistence unit. The result of this method corresponds to the shared-cache-mode element in the persistence.xml file.

Returns:SharedCacheMode

the second-level cache mode that must be used by the provider for the persistence unit

Annotations
@Override
Since
Java Persistence 2.0
See Also
PersistenceUnitInfo#getSharedCacheMode()
getTransactionTypeback to summary
public PersistenceUnitTransactionType getTransactionType()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getTransactionType.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getTransactionType.

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.

Returns:PersistenceUnitTransactionType

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.

Annotations
@Override
getValidationModeback to summary
public ValidationMode getValidationMode()

Implements jakarta.persistence.spi.PersistenceUnitInfo.getValidationMode.

Doc from jakarta.persistence.spi.PersistenceUnitInfo.getValidationMode.

Returns the validation mode to be used by the persistence provider for the persistence unit. The validation mode corresponds to the validation-mode element in the persistence.xml file.

Returns:ValidationMode

the validation mode to be used by the persistence provider for the persistence unit

Annotations
@Override
Since
Java Persistence 2.0
See Also
PersistenceUnitInfo#getValidationMode()
setClassLoaderback to summary
public void setClassLoader(ClassLoader loader)
setExcludeUnlistedClassesback to summary
public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
setJarFileUrlsback to summary
public void setJarFileUrls(List<URL> jarFileUrls)
setJtaDataSourceback to summary
public void setJtaDataSource(DataSource jtaDataSource)
setManagedClassNamesback to summary
public void setManagedClassNames(List<String> managedClassNames)
setMappingFileNamesback to summary
public void setMappingFileNames(List<String> mappingFiles)
setNewTempClassLoaderback to summary
public void setNewTempClassLoader(ClassLoader loader)
setNonJtaDataSourceback to summary
public void setNonJtaDataSource(DataSource nonJtaDataSource)
setPersistenceProviderClassNameback to summary
public void setPersistenceProviderClassName(String persistenceProviderClassName)
setPersistenceUnitNameback to summary
public void setPersistenceUnitName(String persistenceUnitName)
setPersistenceUnitPropertiesback to summary
public void setPersistenceUnitProperties(List<SEPersistenceUnitProperty> persistenceUnitProperties)

Used with the OX mapping file for the Canonical model processor.

setPersistenceUnitRootUrlback to summary
public void setPersistenceUnitRootUrl(URL persistenceUnitRootUrl)
setPropertiesback to summary
public void setProperties(Properties properties)
setSharedCacheModeback to summary
public void setSharedCacheMode(String sharedCacheMode)
Since
Java Persistence 2.0
See Also
PersistenceUnitInfo#getSharedCacheMode()
setTransactionTypeback to summary
public void setTransactionType(PersistenceUnitTransactionType persistenceUnitTransactionType)
setValidationModeback to summary
public void setValidationMode(String validationMode)
Since
Java Persistence 2.0
See Also
PersistenceUnitInfo#getValidationMode()