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 TypeMethodDescriptionvoidaddTransformer(javax.persistence.spi.ClassTransformer transformer) booleanjavax.persistence.SharedCacheModejavax.persistence.spi.PersistenceUnitTransactionTypejavax.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)DataSourceto be used to connect to the database. The data source corresponds to the namednon-jta-data-sourceelement in thepersistence.xmlfile 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 namedclasselement in thepersistence.xmlfile.properties- A map with additional properties that are passed to the JPA provider. Each property corresponds to a property element in thepersistence.xmlfile or to a property set by the container.
-
-
Method Details
-
getPersistenceUnitName
- Specified by:
getPersistenceUnitNamein interfacejavax.persistence.spi.PersistenceUnitInfo
-
getPersistenceProviderClassName
- Specified by:
getPersistenceProviderClassNamein interfacejavax.persistence.spi.PersistenceUnitInfo
-
getTransactionType
public javax.persistence.spi.PersistenceUnitTransactionType getTransactionType()- Specified by:
getTransactionTypein interfacejavax.persistence.spi.PersistenceUnitInfo
-
getJtaDataSource
- Specified by:
getJtaDataSourcein interfacejavax.persistence.spi.PersistenceUnitInfo
-
getNonJtaDataSource
- Specified by:
getNonJtaDataSourcein interfacejavax.persistence.spi.PersistenceUnitInfo
-
getMappingFileNames
- Specified by:
getMappingFileNamesin interfacejavax.persistence.spi.PersistenceUnitInfo
-
getJarFileUrls
- Specified by:
getJarFileUrlsin interfacejavax.persistence.spi.PersistenceUnitInfo
-
getPersistenceUnitRootUrl
- Specified by:
getPersistenceUnitRootUrlin interfacejavax.persistence.spi.PersistenceUnitInfo
-
getManagedClassNames
- Specified by:
getManagedClassNamesin interfacejavax.persistence.spi.PersistenceUnitInfo
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()- Specified by:
excludeUnlistedClassesin interfacejavax.persistence.spi.PersistenceUnitInfo
-
getValidationMode
public javax.persistence.ValidationMode getValidationMode()- Specified by:
getValidationModein interfacejavax.persistence.spi.PersistenceUnitInfo
-
getProperties
- Specified by:
getPropertiesin interfacejavax.persistence.spi.PersistenceUnitInfo
-
getPersistenceXMLSchemaVersion
- Specified by:
getPersistenceXMLSchemaVersionin interfacejavax.persistence.spi.PersistenceUnitInfo
-
getClassLoader
- Specified by:
getClassLoaderin interfacejavax.persistence.spi.PersistenceUnitInfo
-
addTransformer
public void addTransformer(javax.persistence.spi.ClassTransformer transformer) - Specified by:
addTransformerin interfacejavax.persistence.spi.PersistenceUnitInfo
-
getNewTempClassLoader
- Specified by:
getNewTempClassLoaderin interfacejavax.persistence.spi.PersistenceUnitInfo
-