public class MutablePersistenceUnitInfo extends java.lang.Object implements SmartPersistenceUnitInfo
PersistenceUnitInfo
interface,
used to bootstrap an EntityManagerFactory
in a container.
This implementation is largely a JavaBean, offering mutators
for all standard PersistenceUnitInfo
properties.
Constructor and Description |
---|
MutablePersistenceUnitInfo() |
Modifier and Type | Method and Description |
---|---|
void |
addJarFileUrl(java.net.URL jarFileUrl) |
void |
addManagedClassName(java.lang.String managedClassName)
Add a managed class name to the persistence provider's metadata.
|
void |
addManagedPackage(java.lang.String packageName)
Add a managed package to the persistence provider's metadata.
|
void |
addMappingFileName(java.lang.String mappingFileName) |
void |
addProperty(java.lang.String name,
java.lang.String value) |
void |
addTransformer(ClassTransformer classTransformer)
This implementation throws an UnsupportedOperationException.
|
boolean |
excludeUnlistedClasses() |
java.lang.ClassLoader |
getClassLoader()
This implementation returns the default ClassLoader.
|
java.util.List<java.net.URL> |
getJarFileUrls() |
javax.sql.DataSource |
getJtaDataSource() |
java.util.List<java.lang.String> |
getManagedClassNames() |
java.util.List<java.lang.String> |
getManagedPackages()
Return a list of managed Java packages, to be introspected by the persistence provider.
|
java.util.List<java.lang.String> |
getMappingFileNames() |
java.lang.ClassLoader |
getNewTempClassLoader()
This implementation throws an UnsupportedOperationException.
|
javax.sql.DataSource |
getNonJtaDataSource() |
java.lang.String |
getPersistenceProviderClassName() |
java.lang.String |
getPersistenceProviderPackageName() |
java.lang.String |
getPersistenceUnitName() |
java.net.URL |
getPersistenceUnitRootUrl() |
java.lang.String |
getPersistenceXMLSchemaVersion() |
java.util.Properties |
getProperties() |
SharedCacheMode |
getSharedCacheMode() |
PersistenceUnitTransactionType |
getTransactionType() |
ValidationMode |
getValidationMode() |
void |
setExcludeUnlistedClasses(boolean excludeUnlistedClasses) |
void |
setJtaDataSource(javax.sql.DataSource jtaDataSource) |
void |
setNonJtaDataSource(javax.sql.DataSource nonJtaDataSource) |
void |
setPersistenceProviderClassName(java.lang.String persistenceProviderClassName) |
void |
setPersistenceProviderPackageName(java.lang.String persistenceProviderPackageName)
Set the persistence provider's own package name, for exclusion from class transformation.
|
void |
setPersistenceUnitName(java.lang.String persistenceUnitName) |
void |
setPersistenceUnitRootUrl(java.net.URL persistenceUnitRootUrl) |
void |
setPersistenceXMLSchemaVersion(java.lang.String persistenceXMLSchemaVersion) |
void |
setProperties(java.util.Properties properties) |
void |
setSharedCacheMode(SharedCacheMode sharedCacheMode) |
void |
setTransactionType(PersistenceUnitTransactionType transactionType) |
void |
setValidationMode(ValidationMode validationMode) |
java.lang.String |
toString() |
public void setPersistenceUnitName(@Nullable java.lang.String persistenceUnitName)
@Nullable public java.lang.String getPersistenceUnitName()
getPersistenceUnitName
in interface PersistenceUnitInfo
public void setPersistenceProviderClassName(@Nullable java.lang.String persistenceProviderClassName)
@Nullable public java.lang.String getPersistenceProviderClassName()
getPersistenceProviderClassName
in interface PersistenceUnitInfo
public void setTransactionType(PersistenceUnitTransactionType transactionType)
public PersistenceUnitTransactionType getTransactionType()
getTransactionType
in interface PersistenceUnitInfo
public void setJtaDataSource(@Nullable javax.sql.DataSource jtaDataSource)
@Nullable public javax.sql.DataSource getJtaDataSource()
getJtaDataSource
in interface PersistenceUnitInfo
public void setNonJtaDataSource(@Nullable javax.sql.DataSource nonJtaDataSource)
@Nullable public javax.sql.DataSource getNonJtaDataSource()
getNonJtaDataSource
in interface PersistenceUnitInfo
public void addMappingFileName(java.lang.String mappingFileName)
public java.util.List<java.lang.String> getMappingFileNames()
getMappingFileNames
in interface PersistenceUnitInfo
public void addJarFileUrl(java.net.URL jarFileUrl)
public java.util.List<java.net.URL> getJarFileUrls()
getJarFileUrls
in interface PersistenceUnitInfo
public void setPersistenceUnitRootUrl(@Nullable java.net.URL persistenceUnitRootUrl)
@Nullable public java.net.URL getPersistenceUnitRootUrl()
getPersistenceUnitRootUrl
in interface PersistenceUnitInfo
public void addManagedClassName(java.lang.String managedClassName)
public java.util.List<java.lang.String> getManagedClassNames()
getManagedClassNames
in interface PersistenceUnitInfo
public void addManagedPackage(java.lang.String packageName)
Note: This refers to annotated package-info.java
files. It does
not trigger entity scanning in the specified package; this is
rather the job of DefaultPersistenceUnitManager.setPackagesToScan(java.lang.String...)
.
SmartPersistenceUnitInfo.getManagedPackages()
,
addManagedClassName(java.lang.String)
public java.util.List<java.lang.String> getManagedPackages()
SmartPersistenceUnitInfo
PersistenceUnitInfo.getManagedClassNames()
.getManagedPackages
in interface SmartPersistenceUnitInfo
public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
public boolean excludeUnlistedClasses()
excludeUnlistedClasses
in interface PersistenceUnitInfo
public void setSharedCacheMode(SharedCacheMode sharedCacheMode)
public SharedCacheMode getSharedCacheMode()
getSharedCacheMode
in interface PersistenceUnitInfo
public void setValidationMode(ValidationMode validationMode)
public ValidationMode getValidationMode()
getValidationMode
in interface PersistenceUnitInfo
public void addProperty(java.lang.String name, java.lang.String value)
public void setProperties(java.util.Properties properties)
public java.util.Properties getProperties()
getProperties
in interface PersistenceUnitInfo
public void setPersistenceXMLSchemaVersion(java.lang.String persistenceXMLSchemaVersion)
public java.lang.String getPersistenceXMLSchemaVersion()
getPersistenceXMLSchemaVersion
in interface PersistenceUnitInfo
public void setPersistenceProviderPackageName(@Nullable java.lang.String persistenceProviderPackageName)
SmartPersistenceUnitInfo
@Nullable public java.lang.String getPersistenceProviderPackageName()
@Nullable public java.lang.ClassLoader getClassLoader()
getClassLoader
in interface PersistenceUnitInfo
ClassUtils.getDefaultClassLoader()
public void addTransformer(ClassTransformer classTransformer)
addTransformer
in interface PersistenceUnitInfo
public java.lang.ClassLoader getNewTempClassLoader()
getNewTempClassLoader
in interface PersistenceUnitInfo
public java.lang.String toString()
toString
in class java.lang.Object