PersistenceUnitInfo
Interface implemented by the container and used by the persistence provider when creating an EntityManagerFactory.
- Since:
- JPA 1.0
Public Methods
void addTransformer(ClassTransformer transformer)
The transformer has no effect on the result returned by the 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- provider-supplied transformer that the container invokes at class-(re)definition time
- Since:
- JPA 1.0
boolean excludeUnlistedClasses()
This value corresponds to the
exclude-unlisted-classes element in the persistence.xml file. - Return:
- 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
- Since:
- JPA 1.0
ClassLoader getClassLoader()
- Return:
- ClassLoader that the provider may use to load any classes, resources, or open URLs
- Since:
- JPA 1.0
List<URL> getJarFileUrls()
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. - Return:
- a list of URL objects referring to jar files or directories
- Since:
- JPA 1.0
DataSource getJtaDataSource()
The data source corresponds to the
jta-data-source element in the persistence.xml file or is provided at deployment or by the container. - Return:
- the JTA-enabled data source to be used by the persistence provider
- Since:
- JPA 1.0
List<String> getManagedClassNames()
Each name corresponds to a named
class element in the persistence.xml file. - Return:
- the list of the names of the classes that the persistence provider must add to its set of managed classes
- Since:
- JPA 1.0
List<String> getMappingFileNames()
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. - Return:
- the list of mapping file names that the persistence provider must load to determine the mappings for the entity classes
- Since:
- JPA 1.0
ClassLoader getNewTempClassLoader()
The scope and classpath of this loader is exactly the same as that of the loader returned by getClassLoader(). None of the classes loaded by this class loader are visible to application components. The provider may only use this
ClassLoader within the scope of the createContainerEntityManagerFactory() call. - Return:
- temporary {@code ClassLoader} with same visibility as current loader
- Since:
- JPA 1.0
DataSource getNonJtaDataSource()
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. - Return:
- the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction
- Since:
- JPA 1.0
String getPersistenceProviderClassName()
Corresponds to the
provider element in the persistence.xml file. - Return:
- the fully qualified name of the persistence provider implementation class
- Since:
- JPA 1.0
String getPersistenceUnitName()
Corresponds to the
name attribute in the persistence.xml file. - Return:
- the name of the persistence unit
- Since:
- JPA 1.0
(If the persistence unit is rooted in the WEB-INF/classes directory, this is 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.
- Return:
- a URL referring to a jar file or directory
- Since:
- JPA 1.0
String getPersistenceXMLSchemaVersion()
- Return:
- {@code persistence.xml} schema version
- Since:
- JPA 2.0
Properties getProperties()
Each property corresponds to a
property element in the persistence.xml file or to a property set by the container. - Return:
- Properties object
- Since:
- JPA 1.0
List<String> getQualifierAnnotationNames()
Corresponds to the
qualifier element in persistence.xml. - Return:
- the fully-qualified class names of the qualifier annotations, or an empty list if no qualifier annotations were explicitly specified
- Since:
- JPA 1.0
String getScopeAnnotationName()
Corresponds to the
scope element in persistence.xml. - Return:
- the fully-qualified class name of the scope annotation, or null if no scope was explicitly specified
- Since:
- JPA 1.0
The result of this method corresponds to the
shared-cache-mode element in the persistence.xml file. - Return:
- the second-level cache mode that must be used by the provider for the persistence unit
- Since:
- JPA 2.0
The transaction type corresponds to the
transaction-type attribute in the persistence.xml file. - Return:
- transaction type of the entity managers created by the EntityManagerFactory
Note: This method will change its return type to {@link jakarta.persistence.PersistenceUnitTransactionType} in the next major version.
- Since:
- JPA 1.0
The validation mode corresponds to the
validation-mode element in the persistence.xml file. - Return:
- the validation mode to be used by the persistence provider for the persistence unit
- Since:
- JPA 2.0