Class MutablePersistenceUnitInfo
java.lang.Object
org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
- All Implemented Interfaces:
PersistenceUnitInfo
,SmartPersistenceUnitInfo
Spring's base implementation of the JPA
PersistenceUnitInfo
interface,
used to bootstrap an EntityManagerFactory
in a container.
This implementation is largely a JavaBean, offering mutators
for all standard PersistenceUnitInfo
properties.
- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller, Costin Leau
-
Constructor Summary
-
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
addTransformer
(ClassTransformer classTransformer) This implementation throws an UnsupportedOperationException.boolean
This implementation returns the default ClassLoader.Return a list of managed Java packages, to be introspected by the persistence provider.This implementation throws an UnsupportedOperationException.void
setExcludeUnlistedClasses
(boolean excludeUnlistedClasses) void
setJtaDataSource
(DataSource jtaDataSource) void
setNonJtaDataSource
(DataSource nonJtaDataSource) void
setPersistenceProviderClassName
(String persistenceProviderClassName) void
setPersistenceProviderPackageName
(String persistenceProviderPackageName) Set the persistence provider's own package name, for exclusion from class transformation.void
setPersistenceUnitName
(String persistenceUnitName) void
setPersistenceUnitRootUrl
(URL persistenceUnitRootUrl) void
setPersistenceXMLSchemaVersion
(String persistenceXMLSchemaVersion) void
setProperties
(Properties properties) void
setSharedCacheMode
(SharedCacheMode sharedCacheMode) void
setTransactionType
(PersistenceUnitTransactionType transactionType) void
setValidationMode
(ValidationMode validationMode) toString()
-
Constructor Details
-
MutablePersistenceUnitInfo
public MutablePersistenceUnitInfo()
-
-
Method Details
-
setPersistenceUnitName
-
getPersistenceUnitName
- Specified by:
getPersistenceUnitName
in interfacePersistenceUnitInfo
-
setPersistenceProviderClassName
-
getPersistenceProviderClassName
- Specified by:
getPersistenceProviderClassName
in interfacePersistenceUnitInfo
-
setTransactionType
-
getTransactionType
- Specified by:
getTransactionType
in interfacePersistenceUnitInfo
-
setJtaDataSource
-
getJtaDataSource
- Specified by:
getJtaDataSource
in interfacePersistenceUnitInfo
-
setNonJtaDataSource
-
getNonJtaDataSource
- Specified by:
getNonJtaDataSource
in interfacePersistenceUnitInfo
-
addMappingFileName
-
getMappingFileNames
- Specified by:
getMappingFileNames
in interfacePersistenceUnitInfo
-
addJarFileUrl
-
getJarFileUrls
- Specified by:
getJarFileUrls
in interfacePersistenceUnitInfo
-
setPersistenceUnitRootUrl
-
getPersistenceUnitRootUrl
- Specified by:
getPersistenceUnitRootUrl
in interfacePersistenceUnitInfo
-
addManagedClassName
Add a managed class name to the persistence provider's metadata. -
getManagedClassNames
- Specified by:
getManagedClassNames
in interfacePersistenceUnitInfo
-
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(java.lang.String...)
.- Since:
- 4.1
- See Also:
-
getManagedPackages
Description copied from interface:SmartPersistenceUnitInfo
Return a list of managed Java packages, to be introspected by the persistence provider. Typically found through scanning but not exposable throughPersistenceUnitInfo.getManagedClassNames()
.- Specified by:
getManagedPackages
in interfaceSmartPersistenceUnitInfo
- Returns:
- a list of names of managed Java packages (potentially empty)
-
setExcludeUnlistedClasses
public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses) -
excludeUnlistedClasses
public boolean excludeUnlistedClasses()- Specified by:
excludeUnlistedClasses
in interfacePersistenceUnitInfo
-
setValidationMode
-
getValidationMode
- Specified by:
getValidationMode
in interfacePersistenceUnitInfo
-
addProperty
-
setProperties
-
getProperties
- Specified by:
getProperties
in interfacePersistenceUnitInfo
-
setPersistenceXMLSchemaVersion
-
getPersistenceXMLSchemaVersion
- Specified by:
getPersistenceXMLSchemaVersion
in interfacePersistenceUnitInfo
-
setPersistenceProviderPackageName
Description copied from interface:SmartPersistenceUnitInfo
Set the persistence provider's own package name, for exclusion from class transformation. -
getPersistenceProviderPackageName
-
getClassLoader
This implementation returns the default ClassLoader.- Specified by:
getClassLoader
in interfacePersistenceUnitInfo
- See Also:
-
addTransformer
This implementation throws an UnsupportedOperationException.- Specified by:
addTransformer
in interfacePersistenceUnitInfo
-
getNewTempClassLoader
This implementation throws an UnsupportedOperationException.- Specified by:
getNewTempClassLoader
in interfacePersistenceUnitInfo
-
toString
-