public class PersistenceUnitInfoImpl extends 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 String |
PERSISTENCE_VERSION |
SRC_ANNOTATIONS, SRC_OTHER, SRC_XML
Constructor and Description |
---|
PersistenceUnitInfoImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addJarFile(URL jar) |
void |
addJarFileName(String name) |
void |
addManagedClassName(String name) |
void |
addMappingFileName(String name) |
void |
addTransformer(javax.persistence.spi.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.
|
String |
getPersistenceXMLSchemaVersion() |
Properties |
getProperties() |
String |
getResourceName()
Return the domain-meaningful name of the resource that was loaded
from this source.
|
javax.persistence.SharedCacheMode |
getSharedCacheMode() |
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.
|
javax.persistence.spi.PersistenceUnitTransactionType |
getTransactionType() |
javax.persistence.ValidationMode |
getValidationMode() |
void |
processJarFileNames()
Process jar-file elements.
|
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 |
setPersistenceXMLSchemaVersion(String version) |
void |
setProperty(String key,
String value) |
void |
setSharedCacheMode(javax.persistence.SharedCacheMode mode) |
void |
setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transType) |
void |
setValidationMode(javax.persistence.ValidationMode mode) |
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(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. |
void |
validateJarFileName(String name) |
public static final String PERSISTENCE_VERSION
public ClassLoader getClassLoader()
getClassLoader
in interface javax.persistence.spi.PersistenceUnitInfo
public ClassLoader getNewTempClassLoader()
getNewTempClassLoader
in interface javax.persistence.spi.PersistenceUnitInfo
public String getPersistenceUnitName()
getPersistenceUnitName
in interface javax.persistence.spi.PersistenceUnitInfo
public void setPersistenceUnitName(String emName)
public String getPersistenceProviderClassName()
getPersistenceProviderClassName
in interface javax.persistence.spi.PersistenceUnitInfo
public void setPersistenceProviderClassName(String providerClassName)
public javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()
getTransactionType
in interface javax.persistence.spi.PersistenceUnitInfo
public void setTransactionType(javax.persistence.spi.PersistenceUnitTransactionType transType)
public String getJtaDataSourceName()
public void setJtaDataSourceName(String jta)
public DataSource getJtaDataSource()
getJtaDataSource
in interface javax.persistence.spi.PersistenceUnitInfo
public void setJtaDataSource(DataSource ds)
public String getNonJtaDataSourceName()
public void setNonJtaDataSourceName(String nonJta)
public DataSource getNonJtaDataSource()
getNonJtaDataSource
in interface javax.persistence.spi.PersistenceUnitInfo
public void setNonJtaDataSource(DataSource ds)
public URL getPersistenceUnitRootUrl()
getPersistenceUnitRootUrl
in interface javax.persistence.spi.PersistenceUnitInfo
public void setPersistenceUnitRootUrl(URL root)
public boolean excludeUnlistedClasses()
excludeUnlistedClasses
in interface javax.persistence.spi.PersistenceUnitInfo
public void setExcludeUnlistedClasses(boolean excludeUnlisted)
public List<String> getMappingFileNames()
getMappingFileNames
in interface javax.persistence.spi.PersistenceUnitInfo
public void addMappingFileName(String name)
public List<URL> getJarFileUrls()
getJarFileUrls
in interface javax.persistence.spi.PersistenceUnitInfo
public void addJarFile(URL jar)
public void addJarFileName(String name)
public void processJarFileNames()
public void validateJarFileName(String name)
public List<String> getManagedClassNames()
getManagedClassNames
in interface javax.persistence.spi.PersistenceUnitInfo
public void addManagedClassName(String name)
public Properties getProperties()
getProperties
in interface javax.persistence.spi.PersistenceUnitInfo
public void addTransformer(javax.persistence.spi.ClassTransformer transformer)
addTransformer
in interface javax.persistence.spi.PersistenceUnitInfo
public URL getPersistenceXmlFileUrl()
public void setPersistenceXmlFileUrl(URL url)
public void fromUserProperties(Map map)
public Map toOpenJPAProperties()
Map
containing the properties necessary to create
a Configuration
that reflects the information in this
persistence unit info.public static 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 File getSourceFile()
SourceTracker
getSourceFile
in interface SourceTracker
public 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 String getResourceName()
SourceTracker
getResourceName
in interface SourceTracker
public String getPersistenceXMLSchemaVersion()
getPersistenceXMLSchemaVersion
in interface javax.persistence.spi.PersistenceUnitInfo
public void setPersistenceXMLSchemaVersion(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)
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.