public class PluginPersistenceUnitInfo extends Object implements javax.persistence.spi.PersistenceUnitInfo
PersistenceUnitInfo
, intended for entities plugin. This is used to create an
entity manager factory, which requires a persistence unit. Essentially, the PersistenceUnitInfo
can be
thought of as the parsed persistence.xml
file, so this lets us create a virtual persistence.xml
in-memory.Constructor and Description |
---|
PluginPersistenceUnitInfo(ClassLoader classLoader,
DataSource dataSource,
String persistenceUnitName,
Collection<Class<?>> managedClasses,
Properties properties) |
Modifier and Type | Method and Description |
---|---|
void |
addTransformer(javax.persistence.spi.ClassTransformer transformer) |
boolean |
excludeUnlistedClasses() |
ClassLoader |
getClassLoader() |
List<URL> |
getJarFileUrls() |
DataSource |
getJtaDataSource() |
List<String> |
getManagedClassNames() |
List<String> |
getMappingFileNames() |
ClassLoader |
getNewTempClassLoader() |
DataSource |
getNonJtaDataSource() |
String |
getPersistenceProviderClassName() |
String |
getPersistenceUnitName() |
URL |
getPersistenceUnitRootUrl() |
String |
getPersistenceXMLSchemaVersion() |
Properties |
getProperties() |
javax.persistence.SharedCacheMode |
getSharedCacheMode() |
javax.persistence.spi.PersistenceUnitTransactionType |
getTransactionType() |
javax.persistence.ValidationMode |
getValidationMode() |
public PluginPersistenceUnitInfo(ClassLoader classLoader, DataSource dataSource, String persistenceUnitName, Collection<Class<?>> managedClasses, Properties properties)
classLoader
- The class loader that is passed to the JPA provider for loading entity classes etc.dataSource
- The (non-JTA) DataSource
to be used to connect to the database. The data source
corresponds to the named non-jta-data-source
element in the persistence.xml
file or provided at
deployment or by the container.persistenceUnitName
- The name of the persistence unit. If you pass null
, a new name is generated.managedClasses
- A list of entity classes that will be available. Each name corresponds to a named
class
element in the persistence.xml
file.properties
- A map with additional properties that are passed to the JPA provider. Each property corresponds
to a property element in the persistence.xml
file or to a property set by the container.public String getPersistenceUnitName()
getPersistenceUnitName
in interface javax.persistence.spi.PersistenceUnitInfo
public String getPersistenceProviderClassName()
getPersistenceProviderClassName
in interface javax.persistence.spi.PersistenceUnitInfo
public javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()
getTransactionType
in interface javax.persistence.spi.PersistenceUnitInfo
public DataSource getJtaDataSource()
getJtaDataSource
in interface javax.persistence.spi.PersistenceUnitInfo
public DataSource getNonJtaDataSource()
getNonJtaDataSource
in interface javax.persistence.spi.PersistenceUnitInfo
public List<String> getMappingFileNames()
getMappingFileNames
in interface javax.persistence.spi.PersistenceUnitInfo
public List<URL> getJarFileUrls()
getJarFileUrls
in interface javax.persistence.spi.PersistenceUnitInfo
public URL getPersistenceUnitRootUrl()
getPersistenceUnitRootUrl
in interface javax.persistence.spi.PersistenceUnitInfo
public List<String> getManagedClassNames()
getManagedClassNames
in interface javax.persistence.spi.PersistenceUnitInfo
public boolean excludeUnlistedClasses()
excludeUnlistedClasses
in interface javax.persistence.spi.PersistenceUnitInfo
public javax.persistence.SharedCacheMode getSharedCacheMode()
getSharedCacheMode
in interface javax.persistence.spi.PersistenceUnitInfo
public javax.persistence.ValidationMode getValidationMode()
getValidationMode
in interface javax.persistence.spi.PersistenceUnitInfo
public Properties getProperties()
getProperties
in interface javax.persistence.spi.PersistenceUnitInfo
public String getPersistenceXMLSchemaVersion()
getPersistenceXMLSchemaVersion
in interface javax.persistence.spi.PersistenceUnitInfo
public ClassLoader getClassLoader()
getClassLoader
in interface javax.persistence.spi.PersistenceUnitInfo
public void addTransformer(javax.persistence.spi.ClassTransformer transformer)
addTransformer
in interface javax.persistence.spi.PersistenceUnitInfo
public ClassLoader getNewTempClassLoader()
getNewTempClassLoader
in interface javax.persistence.spi.PersistenceUnitInfo
Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.