Class SpringPersistenceUnitInfo
java.lang.Object
org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo
Subclass of
MutablePersistenceUnitInfo
that adds instrumentation hooks based on
Spring's LoadTimeWeaver
abstraction.
As of 7.0, this class is public for custom bootstrapping purposes. A fully configured
SpringPersistenceUnitInfo
instance can be turned into a standard JPA descriptor
through asStandardPersistenceUnitInfo()
(returning a JPA 3.2/4.0 adapted proxy).
Note: For post-processing within a LocalContainerEntityManagerFactoryBean
bootstrap, the base type MutablePersistenceUnitInfo
is entirely sufficient.
- Since:
- 7.0
- Author:
- Rod Johnson, Juergen Hoeller, Costin Leau
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSpringPersistenceUnitInfo
(ClassLoader classLoader) Construct a new SpringPersistenceUnitInfo for custom purposes.SpringPersistenceUnitInfo
(LoadTimeWeaver loadTimeWeaver) Construct a new SpringPersistenceUnitInfo for custom purposes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransformer
(jakarta.persistence.spi.ClassTransformer classTransformer) This implementation delegates to the LoadTimeWeaver, if specified.jakarta.persistence.spi.PersistenceUnitInfo
Expose a standardjakarta.persistence.spi.PersistenceUnitInfo
proxy for the persistence unit configuration in thisSpringPersistenceUnitInfo
instance.This implementation returns the LoadTimeWeaver's instrumentable ClassLoader, if specified.This implementation delegates to the LoadTimeWeaver, if specified.Methods inherited from class MutablePersistenceUnitInfo
addJarFileUrl, addManagedClassName, addManagedPackage, addMappingFileName, addProperty, addQualifierAnnotationName, excludeUnlistedClasses, getJarFileUrls, getJtaDataSource, getManagedClassNames, getManagedPackages, getMappingFileNames, getNonJtaDataSource, getPersistenceProviderClassName, getPersistenceProviderPackageName, getPersistenceUnitName, getPersistenceUnitRootUrl, getPersistenceXMLSchemaVersion, getProperties, getQualifierAnnotationNames, getScopeAnnotationName, getSharedCacheMode, getTransactionType, getValidationMode, setExcludeUnlistedClasses, setJtaDataSource, setNonJtaDataSource, setPersistenceProviderClassName, setPersistenceProviderPackageName, setPersistenceUnitName, setPersistenceUnitRootUrl, setPersistenceXMLSchemaVersion, setProperties, setScopeAnnotationName, setSharedCacheMode, setTransactionType, setValidationMode, toString
-
Constructor Details
-
SpringPersistenceUnitInfo
Construct a new SpringPersistenceUnitInfo for custom purposes.- Parameters:
loadTimeWeaver
- the LoadTimeWeaver to use
-
SpringPersistenceUnitInfo
Construct a new SpringPersistenceUnitInfo for custom purposes.- Parameters:
classLoader
- the ClassLoader to use
-
-
Method Details
-
getClassLoader
This implementation returns the LoadTimeWeaver's instrumentable ClassLoader, if specified. -
addTransformer
public void addTransformer(jakarta.persistence.spi.ClassTransformer classTransformer) This implementation delegates to the LoadTimeWeaver, if specified. -
getNewTempClassLoader
This implementation delegates to the LoadTimeWeaver, if specified. -
asStandardPersistenceUnitInfo
public jakarta.persistence.spi.PersistenceUnitInfo asStandardPersistenceUnitInfo()Expose a standardjakarta.persistence.spi.PersistenceUnitInfo
proxy for the persistence unit configuration in thisSpringPersistenceUnitInfo
instance.The returned proxy implements
jakarta.persistence.spi.PersistenceUnitInfo
(and its extended variantSmartPersistenceUnitInfo
) for use with persistence provider bootstrapping. Note that the returned proxy is effectively unmodifiable and cannot be downcast toMutable/SpringPersistenceUnitInfo
.
-