Spring Framework

org.springframework.orm.jpa.persistenceunit
Class MutablePersistenceUnitInfo

java.lang.Object
  extended by org.springframework.orm.jpa.persistenceunit.MutablePersistenceUnitInfo
All Implemented Interfaces:
javax.persistence.spi.PersistenceUnitInfo, SmartPersistenceUnitInfo

public class MutablePersistenceUnitInfo
extends java.lang.Object
implements 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
MutablePersistenceUnitInfo()
           
 
Method Summary
 void addJarFileUrl(java.net.URL jarFileUrl)
           
 void addManagedClassName(java.lang.String managedClassName)
           
 void addMappingFileName(java.lang.String mappingFileName)
           
 void addProperty(java.lang.String name, java.lang.String value)
           
 void addTransformer(javax.persistence.spi.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> 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()
           
 javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()
           
 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 setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transactionType)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutablePersistenceUnitInfo

public MutablePersistenceUnitInfo()
Method Detail

setPersistenceUnitName

public void setPersistenceUnitName(java.lang.String persistenceUnitName)

getPersistenceUnitName

public java.lang.String getPersistenceUnitName()
Specified by:
getPersistenceUnitName in interface javax.persistence.spi.PersistenceUnitInfo

setPersistenceProviderClassName

public void setPersistenceProviderClassName(java.lang.String persistenceProviderClassName)

getPersistenceProviderClassName

public java.lang.String getPersistenceProviderClassName()
Specified by:
getPersistenceProviderClassName in interface javax.persistence.spi.PersistenceUnitInfo

setTransactionType

public void setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transactionType)

getTransactionType

public javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()
Specified by:
getTransactionType in interface javax.persistence.spi.PersistenceUnitInfo

setJtaDataSource

public void setJtaDataSource(javax.sql.DataSource jtaDataSource)

getJtaDataSource

public javax.sql.DataSource getJtaDataSource()
Specified by:
getJtaDataSource in interface javax.persistence.spi.PersistenceUnitInfo

setNonJtaDataSource

public void setNonJtaDataSource(javax.sql.DataSource nonJtaDataSource)

getNonJtaDataSource

public javax.sql.DataSource getNonJtaDataSource()
Specified by:
getNonJtaDataSource in interface javax.persistence.spi.PersistenceUnitInfo

addMappingFileName

public void addMappingFileName(java.lang.String mappingFileName)

getMappingFileNames

public java.util.List<java.lang.String> getMappingFileNames()
Specified by:
getMappingFileNames in interface javax.persistence.spi.PersistenceUnitInfo

addJarFileUrl

public void addJarFileUrl(java.net.URL jarFileUrl)

getJarFileUrls

public java.util.List<java.net.URL> getJarFileUrls()
Specified by:
getJarFileUrls in interface javax.persistence.spi.PersistenceUnitInfo

setPersistenceUnitRootUrl

public void setPersistenceUnitRootUrl(java.net.URL persistenceUnitRootUrl)

getPersistenceUnitRootUrl

public java.net.URL getPersistenceUnitRootUrl()
Specified by:
getPersistenceUnitRootUrl in interface javax.persistence.spi.PersistenceUnitInfo

addManagedClassName

public void addManagedClassName(java.lang.String managedClassName)

getManagedClassNames

public java.util.List<java.lang.String> getManagedClassNames()
Specified by:
getManagedClassNames in interface javax.persistence.spi.PersistenceUnitInfo

setExcludeUnlistedClasses

public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)

excludeUnlistedClasses

public boolean excludeUnlistedClasses()
Specified by:
excludeUnlistedClasses in interface javax.persistence.spi.PersistenceUnitInfo

addProperty

public void addProperty(java.lang.String name,
                        java.lang.String value)

setProperties

public void setProperties(java.util.Properties properties)

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface javax.persistence.spi.PersistenceUnitInfo

setPersistenceXMLSchemaVersion

public void setPersistenceXMLSchemaVersion(java.lang.String persistenceXMLSchemaVersion)

getPersistenceXMLSchemaVersion

public java.lang.String getPersistenceXMLSchemaVersion()

setPersistenceProviderPackageName

public void setPersistenceProviderPackageName(java.lang.String persistenceProviderPackageName)
Description copied from interface: SmartPersistenceUnitInfo
Set the persistence provider's own package name, for exclusion from class transformation.

Specified by:
setPersistenceProviderPackageName in interface SmartPersistenceUnitInfo
See Also:
PersistenceUnitInfo.addTransformer(javax.persistence.spi.ClassTransformer), PersistenceUnitInfo.getNewTempClassLoader()

getPersistenceProviderPackageName

public java.lang.String getPersistenceProviderPackageName()

getClassLoader

public java.lang.ClassLoader getClassLoader()
This implementation returns the default ClassLoader.

Specified by:
getClassLoader in interface javax.persistence.spi.PersistenceUnitInfo
See Also:
ClassUtils.getDefaultClassLoader()

addTransformer

public void addTransformer(javax.persistence.spi.ClassTransformer classTransformer)
This implementation throws an UnsupportedOperationException.

Specified by:
addTransformer in interface javax.persistence.spi.PersistenceUnitInfo

getNewTempClassLoader

public java.lang.ClassLoader getNewTempClassLoader()
This implementation throws an UnsupportedOperationException.

Specified by:
getNewTempClassLoader in interface javax.persistence.spi.PersistenceUnitInfo

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Spring Framework