org.apache.openjpa.persistence
public class PersistenceUnitInfoImpl extends java.lang.Object implements javax.persistence.spi.PersistenceUnitInfo, SourceTracker
PersistenceUnitInfo
interface used by OpenJPA
when parsing persistence configuration information.Modifier and Type | Class and Description |
---|---|
static class |
PersistenceUnitInfoImpl.ClassResolverImpl
Simple class resolver built around the persistence unit loader.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PERSISTENCE_VERSION |
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
Constructor and Description |
---|
PersistenceUnitInfoImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addJarFile(java.net.URL jar) |
void |
addJarFileName(java.lang.String name) |
void |
addManagedClassName(java.lang.String name) |
void |
addMappingFileName(java.lang.String name) |
void |
addTransformer(javax.persistence.spi.ClassTransformer transformer) |
boolean |
excludeUnlistedClasses() |
void |
fromUserProperties(java.util.Map map)
Load the given user-supplied map of properties into this persistence
unit.
|
java.lang.ClassLoader |
getClassLoader() |
int |
getColNumber()
Return the column number in the line of the file at which this
instance was parsed.
|
java.util.List<java.net.URL> |
getJarFileUrls() |
javax.sql.DataSource |
getJtaDataSource() |
java.lang.String |
getJtaDataSourceName() |
int |
getLineNumber()
Return the line number of the file at which this instance was parsed.
|
java.util.List<java.lang.String> |
getManagedClassNames() |
java.util.List<java.lang.String> |
getMappingFileNames() |
java.lang.ClassLoader |
getNewTempClassLoader() |
javax.sql.DataSource |
getNonJtaDataSource() |
java.lang.String |
getNonJtaDataSourceName() |
java.lang.String |
getPersistenceProviderClassName() |
java.lang.String |
getPersistenceUnitName() |
java.net.URL |
getPersistenceUnitRootUrl() |
java.net.URL |
getPersistenceXmlFileUrl()
The location of the persistence.xml resource.
|
java.lang.String |
getPersistenceXMLSchemaVersion() |
java.util.Properties |
getProperties() |
java.lang.String |
getResourceName()
Return the domain-meaningful name of the resource that was loaded
from this source.
|
javax.persistence.SharedCacheMode |
getSharedCacheMode() |
java.io.File |
getSourceFile()
Return the file from which this instance was parsed.
|
java.lang.Object |
getSourceScope()
Return the domain-dependent scope of this instance within its file.
|
int |
getSourceType()
Return the type of source.
|
javax.persistence.spi.PersistenceUnitTransactionType |
getTransactionType() |
javax.persistence.ValidationMode |
getValidationMode() |
void |
setExcludeUnlistedClasses(boolean excludeUnlisted) |
void |
setJtaDataSource(javax.sql.DataSource ds) |
void |
setJtaDataSourceName(java.lang.String jta) |
void |
setNonJtaDataSource(javax.sql.DataSource ds) |
void |
setNonJtaDataSourceName(java.lang.String nonJta) |
void |
setPersistenceProviderClassName(java.lang.String providerClassName) |
void |
setPersistenceUnitName(java.lang.String emName) |
void |
setPersistenceUnitRootUrl(java.net.URL root) |
void |
setPersistenceXmlFileUrl(java.net.URL url)
The location of the persistence.xml resource.
|
void |
setPersistenceXMLSchemaVersion(java.lang.String version) |
void |
setProperty(java.lang.String key,
java.lang.String value) |
void |
setSharedCacheMode(javax.persistence.SharedCacheMode mode) |
void |
setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transType) |
void |
setValidationMode(javax.persistence.ValidationMode mode) |
java.util.Map |
toOpenJPAProperties()
Return a
Map containing the properties necessary to create
a Configuration that reflects the information in this
persistence unit info. |
static java.util.Map |
toOpenJPAProperties(javax.persistence.spi.PersistenceUnitInfo info)
Return a
Map containing the properties necessary to create
a Configuration that reflects the information in the given
persistence unit info. |
public static final java.lang.String PERSISTENCE_VERSION
public java.lang.ClassLoader getClassLoader()
getClassLoader
in interface javax.persistence.spi.PersistenceUnitInfo
public java.lang.ClassLoader getNewTempClassLoader()
getNewTempClassLoader
in interface javax.persistence.spi.PersistenceUnitInfo
public java.lang.String getPersistenceUnitName()
getPersistenceUnitName
in interface javax.persistence.spi.PersistenceUnitInfo
public void setPersistenceUnitName(java.lang.String emName)
public java.lang.String getPersistenceProviderClassName()
getPersistenceProviderClassName
in interface javax.persistence.spi.PersistenceUnitInfo
public void setPersistenceProviderClassName(java.lang.String providerClassName)
public javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()
getTransactionType
in interface javax.persistence.spi.PersistenceUnitInfo
public void setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transType)
public java.lang.String getJtaDataSourceName()
public void setJtaDataSourceName(java.lang.String jta)
public javax.sql.DataSource getJtaDataSource()
getJtaDataSource
in interface javax.persistence.spi.PersistenceUnitInfo
public void setJtaDataSource(javax.sql.DataSource ds)
public java.lang.String getNonJtaDataSourceName()
public void setNonJtaDataSourceName(java.lang.String nonJta)
public javax.sql.DataSource getNonJtaDataSource()
getNonJtaDataSource
in interface javax.persistence.spi.PersistenceUnitInfo
public void setNonJtaDataSource(javax.sql.DataSource ds)
public java.net.URL getPersistenceUnitRootUrl()
getPersistenceUnitRootUrl
in interface javax.persistence.spi.PersistenceUnitInfo
public void setPersistenceUnitRootUrl(java.net.URL root)
public boolean excludeUnlistedClasses()
excludeUnlistedClasses
in interface javax.persistence.spi.PersistenceUnitInfo
public void setExcludeUnlistedClasses(boolean excludeUnlisted)
public java.util.List<java.lang.String> getMappingFileNames()
getMappingFileNames
in interface javax.persistence.spi.PersistenceUnitInfo
public void addMappingFileName(java.lang.String name)
public java.util.List<java.net.URL> getJarFileUrls()
getJarFileUrls
in interface javax.persistence.spi.PersistenceUnitInfo
public void addJarFile(java.net.URL jar)
public void addJarFileName(java.lang.String name)
public java.util.List<java.lang.String> getManagedClassNames()
getManagedClassNames
in interface javax.persistence.spi.PersistenceUnitInfo
public void addManagedClassName(java.lang.String name)
public java.util.Properties getProperties()
getProperties
in interface javax.persistence.spi.PersistenceUnitInfo
public void setProperty(java.lang.String key, java.lang.String value)
public void addTransformer(javax.persistence.spi.ClassTransformer transformer)
addTransformer
in interface javax.persistence.spi.PersistenceUnitInfo
public java.net.URL getPersistenceXmlFileUrl()
public void setPersistenceXmlFileUrl(java.net.URL url)
public void fromUserProperties(java.util.Map map)
public java.util.Map toOpenJPAProperties()
Map
containing the properties necessary to create
a Configuration
that reflects the information in this
persistence unit info.public static java.util.Map toOpenJPAProperties(javax.persistence.spi.PersistenceUnitInfo info)
Map
containing the properties necessary to create
a Configuration
that reflects the information in the given
persistence unit info.public java.io.File getSourceFile()
SourceTracker
getSourceFile
in interface SourceTracker
public java.lang.Object getSourceScope()
SourceTracker
getSourceScope
in interface SourceTracker
public int getSourceType()
SourceTracker
getSourceType
in interface SourceTracker
public int getLineNumber()
SourceTracker
getLineNumber
in interface SourceTracker
public int getColNumber()
SourceTracker
getColNumber
in interface SourceTracker
public java.lang.String getResourceName()
SourceTracker
getResourceName
in interface SourceTracker
public java.lang.String getPersistenceXMLSchemaVersion()
getPersistenceXMLSchemaVersion
in interface javax.persistence.spi.PersistenceUnitInfo
public void setPersistenceXMLSchemaVersion(java.lang.String version)
public javax.persistence.ValidationMode getValidationMode()
getValidationMode
in interface javax.persistence.spi.PersistenceUnitInfo
public void setValidationMode(javax.persistence.ValidationMode mode)
public javax.persistence.SharedCacheMode getSharedCacheMode()
getSharedCacheMode
in interface javax.persistence.spi.PersistenceUnitInfo
public void setSharedCacheMode(javax.persistence.SharedCacheMode mode)