Class PersistenceUnitInfoImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.jpa.PersistenceUnitInfoImpl
-
- All Implemented Interfaces:
PersistenceUnitInfo
,TapestryPersistenceUnitInfo
public class PersistenceUnitInfoImpl extends java.lang.Object implements TapestryPersistenceUnitInfo
-
-
Constructor Summary
Constructors Constructor Description PersistenceUnitInfoImpl(java.lang.String persistenceUnitName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TapestryPersistenceUnitInfo
addJarFileUrl(java.lang.String url)
Add a URLs for the jar file or exploded jar file directory that the persistence provider must examine for managed classes of the persistence unit.TapestryPersistenceUnitInfo
addJarFileUrl(java.net.URL url)
Add a URLs for the jar file or exploded jar file directory that the persistence provider must examine for managed classes of the persistence unit.TapestryPersistenceUnitInfo
addManagedClass(java.lang.Class<?> clazz)
Add a managed class to be used by persistence provider.TapestryPersistenceUnitInfo
addManagedClassName(java.lang.String className)
Add a managed class name to be used by persistence provider.TapestryPersistenceUnitInfo
addMappingFileName(java.lang.String fileName)
Add a mapping file to be loaded by the persistence provider to determine the mappings for the entity classes.TapestryPersistenceUnitInfo
addProperty(java.lang.String name, java.lang.String value)
Add a property.void
addTransformer(ClassTransformer transformer)
boolean
excludeUnlistedClasses()
TapestryPersistenceUnitInfo
excludeUnlistedClasses(boolean exclude)
Defines whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes.java.lang.ClassLoader
getClassLoader()
java.util.Map
getEntityManagerProperties()
java.util.List<java.net.URL>
getJarFileUrls()
javax.sql.DataSource
getJtaDataSource()
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
getPersistenceProviderClassName()
java.lang.String
getPersistenceUnitName()
java.net.URL
getPersistenceUnitRootUrl()
java.lang.String
getPersistenceXMLSchemaVersion()
java.util.Properties
getProperties()
SharedCacheMode
getSharedCacheMode()
PersistenceUnitTransactionType
getTransactionType()
ValidationMode
getValidationMode()
TapestryPersistenceUnitInfo
jtaDataSource(java.lang.String jtaDataSource)
Set the JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction.TapestryPersistenceUnitInfo
nonJtaDataSource(java.lang.String nonJtaDataSource)
Set the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction.TapestryPersistenceUnitInfo
persistenceProviderClassName(java.lang.String persistenceProviderClassName)
Set the the fully qualified name of the persistence provider implementation class.TapestryPersistenceUnitInfo
setEntityManagerProperties(java.util.Map properties)
PersistenceProvider
allows creating anEntityManagerFactory
with a default EntityManager properties map.void
setPersistenceXMLSchemaVersion(java.lang.String version)
TapestryPersistenceUnitInfo
sharedCacheMode(SharedCacheMode cacheMode)
Defines how the persistence provider must use a second-level cache for the persistence unit.TapestryPersistenceUnitInfo
transactionType(PersistenceUnitTransactionType transactionType)
Set the transaction type of the entity managers.TapestryPersistenceUnitInfo
validationMode(ValidationMode validationMode)
Set the validation mode to be used by the persistence provider for the persistence unit.
-
-
-
Constructor Detail
-
PersistenceUnitInfoImpl
public PersistenceUnitInfoImpl(java.lang.String persistenceUnitName)
-
-
Method Detail
-
getPersistenceUnitName
public java.lang.String getPersistenceUnitName()
- Specified by:
getPersistenceUnitName
in interfacePersistenceUnitInfo
-
getPersistenceProviderClassName
public java.lang.String getPersistenceProviderClassName()
- Specified by:
getPersistenceProviderClassName
in interfacePersistenceUnitInfo
-
persistenceProviderClassName
public TapestryPersistenceUnitInfo persistenceProviderClassName(java.lang.String persistenceProviderClassName)
Set the the fully qualified name of the persistence provider implementation class. Corresponds to theprovider
element in thepersistence.xml
file.- Specified by:
persistenceProviderClassName
in interfaceTapestryPersistenceUnitInfo
- Parameters:
persistenceProviderClassName
- persistence provider's class name
-
getTransactionType
public PersistenceUnitTransactionType getTransactionType()
- Specified by:
getTransactionType
in interfacePersistenceUnitInfo
-
transactionType
public TapestryPersistenceUnitInfo transactionType(PersistenceUnitTransactionType transactionType)
Set the transaction type of the entity managers. Corresponds to thetransaction-type
attribute in thepersistence.xml
file.- Specified by:
transactionType
in interfaceTapestryPersistenceUnitInfo
- Parameters:
transactionType
- transition type to set
-
getJtaDataSource
public javax.sql.DataSource getJtaDataSource()
- Specified by:
getJtaDataSource
in interfacePersistenceUnitInfo
-
getNonJtaDataSource
public javax.sql.DataSource getNonJtaDataSource()
- Specified by:
getNonJtaDataSource
in interfacePersistenceUnitInfo
-
nonJtaDataSource
public TapestryPersistenceUnitInfo nonJtaDataSource(java.lang.String nonJtaDataSource)
Set the non-JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. Corresponds to the namednon-jta-data-source
element in thepersistence.xml
file.- Specified by:
nonJtaDataSource
in interfaceTapestryPersistenceUnitInfo
- Parameters:
nonJtaDataSource
- data source to set
-
jtaDataSource
public TapestryPersistenceUnitInfo jtaDataSource(java.lang.String jtaDataSource)
Set the JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction. Corresponds to the namedjta-data-source
element in thepersistence.xml
file.- Specified by:
jtaDataSource
in interfaceTapestryPersistenceUnitInfo
- Parameters:
jtaDataSource
- data source to set
-
getMappingFileNames
public java.util.List<java.lang.String> getMappingFileNames()
- Specified by:
getMappingFileNames
in interfacePersistenceUnitInfo
-
addMappingFileName
public TapestryPersistenceUnitInfo addMappingFileName(java.lang.String fileName)
Add a mapping file to be loaded by the persistence provider to determine the mappings for the entity classes. Corresponds to amapping-file
element in thepersistence.xml
file.- Specified by:
addMappingFileName
in interfaceTapestryPersistenceUnitInfo
- Parameters:
fileName
- mapping file name to add
-
addJarFileUrl
public TapestryPersistenceUnitInfo addJarFileUrl(java.net.URL url)
Add a URLs for the jar file or exploded jar file directory that the persistence provider must examine for managed classes of the persistence unit. Corresponds to ajar-file
element in thepersistence.xml
file.- Specified by:
addJarFileUrl
in interfaceTapestryPersistenceUnitInfo
- Parameters:
url
- url to add
-
addJarFileUrl
public TapestryPersistenceUnitInfo addJarFileUrl(java.lang.String url)
Add a URLs for the jar file or exploded jar file directory that the persistence provider must examine for managed classes of the persistence unit. Corresponds to ajar-file
element in thepersistence.xml
file.- Specified by:
addJarFileUrl
in interfaceTapestryPersistenceUnitInfo
- Parameters:
url
- url to add
-
addProperty
public TapestryPersistenceUnitInfo addProperty(java.lang.String name, java.lang.String value)
Add a property. Corresponds to aproperty
element in thepersistence.xml
file.- Specified by:
addProperty
in interfaceTapestryPersistenceUnitInfo
- Parameters:
name
- property's namevalue
- property's value
-
excludeUnlistedClasses
public TapestryPersistenceUnitInfo excludeUnlistedClasses(boolean exclude)
Defines whether classes in the root of the persistence unit that have not been explicitly listed are to be included in the set of managed classes. Corresponds to theexclude-unlisted-classes
element in thepersistence.xml
file.- Specified by:
excludeUnlistedClasses
in interfaceTapestryPersistenceUnitInfo
- Parameters:
exclude
- defines whether to exclude or not
-
getJarFileUrls
public java.util.List<java.net.URL> getJarFileUrls()
- Specified by:
getJarFileUrls
in interfacePersistenceUnitInfo
-
getPersistenceUnitRootUrl
public java.net.URL getPersistenceUnitRootUrl()
- Specified by:
getPersistenceUnitRootUrl
in interfacePersistenceUnitInfo
-
getManagedClassNames
public java.util.List<java.lang.String> getManagedClassNames()
- Specified by:
getManagedClassNames
in interfacePersistenceUnitInfo
-
addManagedClassName
public TapestryPersistenceUnitInfo addManagedClassName(java.lang.String className)
Add a managed class name to be used by persistence provider. Corresponds to a namedclass
element in thepersistence.xml
file.- Specified by:
addManagedClassName
in interfaceTapestryPersistenceUnitInfo
- Parameters:
className
- class name to add- See Also:
TapestryPersistenceUnitInfo.addManagedClass(Class)
-
addManagedClass
public TapestryPersistenceUnitInfo addManagedClass(java.lang.Class<?> clazz)
Add a managed class to be used by persistence provider. Corresponds to a namedclass
element in thepersistence.xml
file.- Specified by:
addManagedClass
in interfaceTapestryPersistenceUnitInfo
- Parameters:
clazz
- class to add- See Also:
TapestryPersistenceUnitInfo.addManagedClassName(String)
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()
- Specified by:
excludeUnlistedClasses
in interfacePersistenceUnitInfo
-
getSharedCacheMode
public SharedCacheMode getSharedCacheMode()
- Specified by:
getSharedCacheMode
in interfacePersistenceUnitInfo
-
sharedCacheMode
public TapestryPersistenceUnitInfo sharedCacheMode(SharedCacheMode cacheMode)
Defines how the persistence provider must use a second-level cache for the persistence unit. Corresponds to theshared-cache-mode
element in thepersistence.xml
file.- Specified by:
sharedCacheMode
in interfaceTapestryPersistenceUnitInfo
- Parameters:
cacheMode
- cache mode to set
-
getValidationMode
public ValidationMode getValidationMode()
- Specified by:
getValidationMode
in interfacePersistenceUnitInfo
-
validationMode
public TapestryPersistenceUnitInfo validationMode(ValidationMode validationMode)
Set the validation mode to be used by the persistence provider for the persistence unit. Corresponds to thevalidation-mode
element in thepersistence.xml
file.- Specified by:
validationMode
in interfaceTapestryPersistenceUnitInfo
- Parameters:
validationMode
- validation mode to set
-
getProperties
public java.util.Properties getProperties()
- Specified by:
getProperties
in interfacePersistenceUnitInfo
-
getPersistenceXMLSchemaVersion
public java.lang.String getPersistenceXMLSchemaVersion()
- Specified by:
getPersistenceXMLSchemaVersion
in interfacePersistenceUnitInfo
-
setPersistenceXMLSchemaVersion
public void setPersistenceXMLSchemaVersion(java.lang.String version)
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfacePersistenceUnitInfo
-
addTransformer
public void addTransformer(ClassTransformer transformer)
- Specified by:
addTransformer
in interfacePersistenceUnitInfo
-
getNewTempClassLoader
public java.lang.ClassLoader getNewTempClassLoader()
- Specified by:
getNewTempClassLoader
in interfacePersistenceUnitInfo
-
setEntityManagerProperties
public TapestryPersistenceUnitInfo setEntityManagerProperties(java.util.Map properties)
Description copied from interface:TapestryPersistenceUnitInfo
PersistenceProvider
allows creating anEntityManagerFactory
with a default EntityManager properties map. This operation allows contributing default properties for EntityManager.- Specified by:
setEntityManagerProperties
in interfaceTapestryPersistenceUnitInfo
- Parameters:
properties
- properties to initialize EntityManagerFactory with
-
getEntityManagerProperties
public java.util.Map getEntityManagerProperties()
- Specified by:
getEntityManagerProperties
in interfaceTapestryPersistenceUnitInfo
- Returns:
- Returns the supplied EntityManagerFactory properties. Returns null if not set.
-
-