Package de.xima.fc.plugin.entities
Class PluginPersistenceUnitInfo
java.lang.Object
de.xima.fc.plugin.entities.PluginPersistenceUnitInfo
- All Implemented Interfaces:
javax.persistence.spi.PersistenceUnitInfo
public class PluginPersistenceUnitInfo
extends Object
implements javax.persistence.spi.PersistenceUnitInfo
A simple implementation of a
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.- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
ConstructorsConstructorDescriptionPluginPersistenceUnitInfo
(ClassLoader classLoader, DataSource dataSource, String persistenceUnitName, Collection<Class<?>> managedClasses, Properties properties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransformer
(javax.persistence.spi.ClassTransformer transformer) boolean
javax.persistence.SharedCacheMode
javax.persistence.spi.PersistenceUnitTransactionType
javax.persistence.ValidationMode
-
Constructor Details
-
PluginPersistenceUnitInfo
public PluginPersistenceUnitInfo(ClassLoader classLoader, DataSource dataSource, String persistenceUnitName, Collection<Class<?>> managedClasses, Properties properties) - Parameters:
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 namednon-jta-data-source
element in thepersistence.xml
file or provided at deployment or by the container.persistenceUnitName
- The name of the persistence unit. If you passnull
, a new name is generated.managedClasses
- A list of entity classes that will be available. Each name corresponds to a namedclass
element in thepersistence.xml
file.properties
- A map with additional properties that are passed to the JPA provider. Each property corresponds to a property element in thepersistence.xml
file or to a property set by the container.
-
-
Method Details
-
getPersistenceUnitName
- Specified by:
getPersistenceUnitName
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getPersistenceProviderClassName
- Specified by:
getPersistenceProviderClassName
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getTransactionType
public javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()- Specified by:
getTransactionType
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getJtaDataSource
- Specified by:
getJtaDataSource
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getNonJtaDataSource
- Specified by:
getNonJtaDataSource
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getMappingFileNames
- Specified by:
getMappingFileNames
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getJarFileUrls
- Specified by:
getJarFileUrls
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getPersistenceUnitRootUrl
- Specified by:
getPersistenceUnitRootUrl
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getManagedClassNames
- Specified by:
getManagedClassNames
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()- Specified by:
excludeUnlistedClasses
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getValidationMode
public javax.persistence.ValidationMode getValidationMode()- Specified by:
getValidationMode
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getProperties
- Specified by:
getProperties
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getPersistenceXMLSchemaVersion
- Specified by:
getPersistenceXMLSchemaVersion
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getClassLoader
- Specified by:
getClassLoader
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
addTransformer
public void addTransformer(javax.persistence.spi.ClassTransformer transformer) - Specified by:
addTransformer
in interfacejavax.persistence.spi.PersistenceUnitInfo
-
getNewTempClassLoader
- Specified by:
getNewTempClassLoader
in interfacejavax.persistence.spi.PersistenceUnitInfo
-