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

public class MutablePersistenceUnitInfo
extends Object
implements javax.persistence.spi.PersistenceUnitInfo

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(URL jarFileUrl)
           
 void addManagedClassName(String managedClassName)
           
 void addMappingFileName(String mappingFileName)
           
 void addProperty(String name, String value)
           
 void addTransformer(javax.persistence.spi.ClassTransformer classTransformer)
          This implementation throws an UnsupportedOperationException.
 boolean excludeUnlistedClasses()
           
 ClassLoader getClassLoader()
          This implementation returns the default ClassLoader.
 List<URL> getJarFileUrls()
           
 DataSource getJtaDataSource()
           
 List<String> getManagedClassNames()
           
 List<String> getMappingFileNames()
           
 ClassLoader getNewTempClassLoader()
          This implementation throws an UnsupportedOperationException.
 DataSource getNonJtaDataSource()
           
 String getPersistenceProviderClassName()
           
 String getPersistenceProviderPackageName()
           
 String getPersistenceUnitName()
           
 URL getPersistenceUnitRootUrl()
           
 Properties getProperties()
           
 javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()
           
 void setExcludeUnlistedClasses(boolean excludeUnlistedClasses)
           
 void setJtaDataSource(DataSource jtaDataSource)
           
 void setNonJtaDataSource(DataSource nonJtaDataSource)
           
 void setPersistenceProviderClassName(String persistenceProviderClassName)
           
 void setPersistenceProviderPackageName(String persistenceProviderPackageName)
           
 void setPersistenceUnitName(String persistenceUnitName)
           
 void setPersistenceUnitRootUrl(URL persistenceUnitRootUrl)
           
 void setProperties(Properties properties)
           
 void setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transactionType)
           
 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(String persistenceUnitName)

getPersistenceUnitName

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

setPersistenceProviderClassName

public void setPersistenceProviderClassName(String persistenceProviderClassName)

getPersistenceProviderClassName

public 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(DataSource jtaDataSource)

getJtaDataSource

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

setNonJtaDataSource

public void setNonJtaDataSource(DataSource nonJtaDataSource)

getNonJtaDataSource

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

addMappingFileName

public void addMappingFileName(String mappingFileName)

getMappingFileNames

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

addJarFileUrl

public void addJarFileUrl(URL jarFileUrl)

getJarFileUrls

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

setPersistenceUnitRootUrl

public void setPersistenceUnitRootUrl(URL persistenceUnitRootUrl)

getPersistenceUnitRootUrl

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

addManagedClassName

public void addManagedClassName(String managedClassName)

getManagedClassNames

public List<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(String name,
                        String value)

setProperties

public void setProperties(Properties properties)

getProperties

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

setPersistenceProviderPackageName

public void setPersistenceProviderPackageName(String persistenceProviderPackageName)

getPersistenceProviderPackageName

public String getPersistenceProviderPackageName()

getClassLoader

public 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 ClassLoader getNewTempClassLoader()
This implementation throws an UnsupportedOperationException.

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2008 The Spring Framework.