org.apache.openjpa.persistence
Class PersistenceUnitInfoImpl

java.lang.Object
  extended by org.apache.openjpa.persistence.PersistenceUnitInfoImpl
All Implemented Interfaces:
SourceTracker

public class PersistenceUnitInfoImpl
extends Object
implements SourceTracker

Implementation of the PersistenceUnitInfo interface used by OpenJPA when parsing persistence configuration information.


Nested Class Summary
static class PersistenceUnitInfoImpl.ClassResolverImpl
          Simple class resolver built around the persistence unit loader.
 
Field Summary
static String KEY_PROVIDER
           
 
Fields inherited from interface org.apache.openjpa.lib.meta.SourceTracker
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
 
Constructor Summary
PersistenceUnitInfoImpl()
           
 
Method Summary
 void addJarFile(URL jar)
           
 void addJarFileName(String name)
           
 void addManagedClassName(String name)
           
 void addMappingFileName(String name)
           
 void addTransformer(ClassTransformer transformer)
           
 boolean excludeUnlistedClasses()
           
 void fromUserProperties(Map map)
          Load the given user-supplied map of properties into this persistence unit.
 ClassLoader getClassLoader()
           
 int getColNumber()
          Return the column number in the line of the file at which this instance was parsed.
 List<URL> getJarFileUrls()
           
 DataSource getJtaDataSource()
           
 String getJtaDataSourceName()
           
 int getLineNumber()
          Return the line number of the file at which this instance was parsed.
 List<String> getManagedClassNames()
           
 List<String> getMappingFileNames()
           
 ClassLoader getNewTempClassLoader()
           
 DataSource getNonJtaDataSource()
           
 String getNonJtaDataSourceName()
           
 String getPersistenceProviderClassName()
           
 String getPersistenceUnitName()
           
 URL getPersistenceUnitRootUrl()
           
 URL getPersistenceXmlFileUrl()
          The location of the persistence.xml resource.
 Properties getProperties()
           
 String getResourceName()
          Return the domain-meaningful name of the resource that was loaded from this source.
 File getSourceFile()
          Return the file from which this instance was parsed.
 Object getSourceScope()
          Return the domain-dependent scope of this instance within its file.
 int getSourceType()
          Return the type of source.
 PersistenceUnitTransactionType getTransactionType()
           
 void setExcludeUnlistedClasses(boolean excludeUnlisted)
           
 void setJtaDataSource(DataSource ds)
           
 void setJtaDataSourceName(String jta)
           
 void setNonJtaDataSource(DataSource ds)
           
 void setNonJtaDataSourceName(String nonJta)
           
 void setPersistenceProviderClassName(String providerClassName)
           
 void setPersistenceUnitName(String emName)
           
 void setPersistenceUnitRootUrl(URL root)
           
 void setPersistenceXmlFileUrl(URL url)
          The location of the persistence.xml resource.
 void setProperty(String key, String value)
           
 void setTransactionType(PersistenceUnitTransactionType transType)
           
 Map toOpenJPAProperties()
          Return a Map containing the properties necessary to create a Configuration that reflects the information in this persistence unit info.
static Map toOpenJPAProperties(PersistenceUnitInfo info)
          Return a Map containing the properties necessary to create a Configuration that reflects the information in the given persistence unit info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_PROVIDER

public static final String KEY_PROVIDER
See Also:
Constant Field Values
Constructor Detail

PersistenceUnitInfoImpl

public PersistenceUnitInfoImpl()
Method Detail

getClassLoader

public ClassLoader getClassLoader()

getNewTempClassLoader

public ClassLoader getNewTempClassLoader()

getPersistenceUnitName

public String getPersistenceUnitName()

setPersistenceUnitName

public void setPersistenceUnitName(String emName)

getPersistenceProviderClassName

public String getPersistenceProviderClassName()

setPersistenceProviderClassName

public void setPersistenceProviderClassName(String providerClassName)

getTransactionType

public PersistenceUnitTransactionType getTransactionType()

setTransactionType

public void setTransactionType(PersistenceUnitTransactionType transType)

getJtaDataSourceName

public String getJtaDataSourceName()

setJtaDataSourceName

public void setJtaDataSourceName(String jta)

getJtaDataSource

public DataSource getJtaDataSource()

setJtaDataSource

public void setJtaDataSource(DataSource ds)

getNonJtaDataSourceName

public String getNonJtaDataSourceName()

setNonJtaDataSourceName

public void setNonJtaDataSourceName(String nonJta)

getNonJtaDataSource

public DataSource getNonJtaDataSource()

setNonJtaDataSource

public void setNonJtaDataSource(DataSource ds)

getPersistenceUnitRootUrl

public URL getPersistenceUnitRootUrl()

setPersistenceUnitRootUrl

public void setPersistenceUnitRootUrl(URL root)

excludeUnlistedClasses

public boolean excludeUnlistedClasses()

setExcludeUnlistedClasses

public void setExcludeUnlistedClasses(boolean excludeUnlisted)

getMappingFileNames

public List<String> getMappingFileNames()

addMappingFileName

public void addMappingFileName(String name)

getJarFileUrls

public List<URL> getJarFileUrls()

addJarFile

public void addJarFile(URL jar)

addJarFileName

public void addJarFileName(String name)

getManagedClassNames

public List<String> getManagedClassNames()

addManagedClassName

public void addManagedClassName(String name)

getProperties

public Properties getProperties()

setProperty

public void setProperty(String key,
                        String value)

addTransformer

public void addTransformer(ClassTransformer transformer)

getPersistenceXmlFileUrl

public URL getPersistenceXmlFileUrl()
The location of the persistence.xml resource. May be null.


setPersistenceXmlFileUrl

public void setPersistenceXmlFileUrl(URL url)
The location of the persistence.xml resource. May be null.


fromUserProperties

public void fromUserProperties(Map map)
Load the given user-supplied map of properties into this persistence unit.


toOpenJPAProperties

public Map toOpenJPAProperties()
Return a Map containing the properties necessary to create a Configuration that reflects the information in this persistence unit info.


toOpenJPAProperties

public static Map toOpenJPAProperties(PersistenceUnitInfo info)
Return a Map containing the properties necessary to create a Configuration that reflects the information in the given persistence unit info.


getSourceFile

public File getSourceFile()
Description copied from interface: SourceTracker
Return the file from which this instance was parsed.

Specified by:
getSourceFile in interface SourceTracker

getSourceScope

public Object getSourceScope()
Description copied from interface: SourceTracker
Return the domain-dependent scope of this instance within its file.

Specified by:
getSourceScope in interface SourceTracker

getSourceType

public int getSourceType()
Description copied from interface: SourceTracker
Return the type of source.

Specified by:
getSourceType in interface SourceTracker

getLineNumber

public int getLineNumber()
Description copied from interface: SourceTracker
Return the line number of the file at which this instance was parsed.

Specified by:
getLineNumber in interface SourceTracker

getColNumber

public int getColNumber()
Description copied from interface: SourceTracker
Return the column number in the line of the file at which this instance was parsed.

Specified by:
getColNumber in interface SourceTracker

getResourceName

public String getResourceName()
Description copied from interface: SourceTracker
Return the domain-meaningful name of the resource that was loaded from this source. I.e., if we had loaded the source for a Java class, this would return the name of the class.

Specified by:
getResourceName in interface SourceTracker


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.