Class MutablePersistenceUnitInfo
- Direct Known Subclasses:
SpringPersistenceUnitInfo
PersistenceUnitInfo
interface,
used to bootstrap an EntityManagerFactory
in a container.
This is the type exposed to PersistenceUnitPostProcessor
.
This implementation is largely a JavaBean, offering mutators
for all standard PersistenceUnitInfo
properties.
As of 7.0, it does not implement PersistenceUnitInfo
but
rather serves as the state behind a runtime PersistenceUnitInfo
(for achieving compatibility between JPA 3.2 and 4.0 and for preventing
late mutation attempts through PersistenceUnitInfo
downcasts).
For custom bootstrapping purposes, use SpringPersistenceUnitInfo
instead, turning it into a jakarta.persistence.spi.PersistenceUnitInfo
through SpringPersistenceUnitInfo.asStandardPersistenceUnitInfo()
.
- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller, Costin Leau
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addJarFileUrl
(URL jarFileUrl) void
addManagedClassName
(String managedClassName) Add a managed class name to the persistence provider's metadata.void
addManagedPackage
(String packageName) Add a managed package to the persistence provider's metadata.void
addMappingFileName
(String mappingFileName) void
addProperty
(String name, String value) void
addQualifierAnnotationName
(String qualifierAnnotationName) boolean
void
setExcludeUnlistedClasses
(boolean excludeUnlistedClasses) void
setJtaDataSource
(@Nullable DataSource jtaDataSource) void
setNonJtaDataSource
(@Nullable DataSource nonJtaDataSource) void
setPersistenceProviderClassName
(@Nullable String persistenceProviderClassName) void
setPersistenceProviderPackageName
(@Nullable String persistenceProviderPackageName) void
setPersistenceUnitName
(@Nullable String persistenceUnitName) void
setPersistenceUnitRootUrl
(@Nullable URL persistenceUnitRootUrl) void
setPersistenceXMLSchemaVersion
(String persistenceXMLSchemaVersion) void
setProperties
(Properties properties) void
setScopeAnnotationName
(@Nullable String scopeAnnotationName) void
setSharedCacheMode
(SharedCacheMode sharedCacheMode) void
setTransactionType
(PersistenceUnitTransactionType transactionType) void
setValidationMode
(ValidationMode validationMode) toString()
-
Constructor Details
-
MutablePersistenceUnitInfo
public MutablePersistenceUnitInfo()
-
-
Method Details
-
setPersistenceUnitName
-
getPersistenceUnitName
-
setPersistenceProviderClassName
-
getPersistenceProviderClassName
-
setScopeAnnotationName
-
getScopeAnnotationName
-
addQualifierAnnotationName
-
getQualifierAnnotationNames
-
setTransactionType
-
getTransactionType
-
setJtaDataSource
-
getJtaDataSource
-
setNonJtaDataSource
-
getNonJtaDataSource
-
addMappingFileName
-
getMappingFileNames
-
addJarFileUrl
-
getJarFileUrls
-
setPersistenceUnitRootUrl
-
getPersistenceUnitRootUrl
-
addManagedClassName
Add a managed class name to the persistence provider's metadata.- See Also:
-
getManagedClassNames
-
addManagedPackage
Add a managed package to the persistence provider's metadata.Note: This refers to annotated
package-info.java
files. It does not trigger entity scanning in the specified package; this is rather the job ofDefaultPersistenceUnitManager.setPackagesToScan(String...)
.- Since:
- 4.1
- See Also:
-
getManagedPackages
-
setExcludeUnlistedClasses
public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses) -
excludeUnlistedClasses
public boolean excludeUnlistedClasses() -
setValidationMode
-
getValidationMode
-
addProperty
-
setProperties
-
getProperties
-
setPersistenceXMLSchemaVersion
-
getPersistenceXMLSchemaVersion
-
setPersistenceProviderPackageName
-
getPersistenceProviderPackageName
-
toString
-