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 TapestryPersistenceUnitInfoaddJarFileUrl(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.TapestryPersistenceUnitInfoaddJarFileUrl(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.TapestryPersistenceUnitInfoaddManagedClass(java.lang.Class<?> clazz)Add a managed class to be used by persistence provider.TapestryPersistenceUnitInfoaddManagedClassName(java.lang.String className)Add a managed class name to be used by persistence provider.TapestryPersistenceUnitInfoaddMappingFileName(java.lang.String fileName)Add a mapping file to be loaded by the persistence provider to determine the mappings for the entity classes.TapestryPersistenceUnitInfoaddProperty(java.lang.String name, java.lang.String value)Add a property.voidaddTransformer(ClassTransformer transformer)booleanexcludeUnlistedClasses()TapestryPersistenceUnitInfoexcludeUnlistedClasses(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.ClassLoadergetClassLoader()java.util.MapgetEntityManagerProperties()java.util.List<java.net.URL>getJarFileUrls()javax.sql.DataSourcegetJtaDataSource()java.util.List<java.lang.String>getManagedClassNames()java.util.List<java.lang.String>getMappingFileNames()java.lang.ClassLoadergetNewTempClassLoader()javax.sql.DataSourcegetNonJtaDataSource()java.lang.StringgetPersistenceProviderClassName()java.lang.StringgetPersistenceUnitName()java.net.URLgetPersistenceUnitRootUrl()java.lang.StringgetPersistenceXMLSchemaVersion()java.util.PropertiesgetProperties()SharedCacheModegetSharedCacheMode()PersistenceUnitTransactionTypegetTransactionType()ValidationModegetValidationMode()TapestryPersistenceUnitInfojtaDataSource(java.lang.String jtaDataSource)Set the JTA-enabled data source to be used by the persistence provider for accessing data outside a JTA transaction.TapestryPersistenceUnitInfononJtaDataSource(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.TapestryPersistenceUnitInfopersistenceProviderClassName(java.lang.String persistenceProviderClassName)Set the the fully qualified name of the persistence provider implementation class.TapestryPersistenceUnitInfosetEntityManagerProperties(java.util.Map properties)PersistenceProviderallows creating anEntityManagerFactorywith a default EntityManager properties map.voidsetPersistenceXMLSchemaVersion(java.lang.String version)TapestryPersistenceUnitInfosharedCacheMode(SharedCacheMode cacheMode)Defines how the persistence provider must use a second-level cache for the persistence unit.TapestryPersistenceUnitInfotransactionType(PersistenceUnitTransactionType transactionType)Set the transaction type of the entity managers.TapestryPersistenceUnitInfovalidationMode(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:
getPersistenceUnitNamein interfacePersistenceUnitInfo
-
getPersistenceProviderClassName
public java.lang.String getPersistenceProviderClassName()
- Specified by:
getPersistenceProviderClassNamein interfacePersistenceUnitInfo
-
persistenceProviderClassName
public TapestryPersistenceUnitInfo persistenceProviderClassName(java.lang.String persistenceProviderClassName)
Set the the fully qualified name of the persistence provider implementation class. Corresponds to theproviderelement in thepersistence.xmlfile.- Specified by:
persistenceProviderClassNamein interfaceTapestryPersistenceUnitInfo- Parameters:
persistenceProviderClassName- persistence provider's class name
-
getTransactionType
public PersistenceUnitTransactionType getTransactionType()
- Specified by:
getTransactionTypein interfacePersistenceUnitInfo
-
transactionType
public TapestryPersistenceUnitInfo transactionType(PersistenceUnitTransactionType transactionType)
Set the transaction type of the entity managers. Corresponds to thetransaction-typeattribute in thepersistence.xmlfile.- Specified by:
transactionTypein interfaceTapestryPersistenceUnitInfo- Parameters:
transactionType- transition type to set
-
getJtaDataSource
public javax.sql.DataSource getJtaDataSource()
- Specified by:
getJtaDataSourcein interfacePersistenceUnitInfo
-
getNonJtaDataSource
public javax.sql.DataSource getNonJtaDataSource()
- Specified by:
getNonJtaDataSourcein 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-sourceelement in thepersistence.xmlfile.- Specified by:
nonJtaDataSourcein 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-sourceelement in thepersistence.xmlfile.- Specified by:
jtaDataSourcein interfaceTapestryPersistenceUnitInfo- Parameters:
jtaDataSource- data source to set
-
getMappingFileNames
public java.util.List<java.lang.String> getMappingFileNames()
- Specified by:
getMappingFileNamesin 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-fileelement in thepersistence.xmlfile.- Specified by:
addMappingFileNamein 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-fileelement in thepersistence.xmlfile.- Specified by:
addJarFileUrlin 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-fileelement in thepersistence.xmlfile.- Specified by:
addJarFileUrlin interfaceTapestryPersistenceUnitInfo- Parameters:
url- url to add
-
addProperty
public TapestryPersistenceUnitInfo addProperty(java.lang.String name, java.lang.String value)
Add a property. Corresponds to apropertyelement in thepersistence.xmlfile.- Specified by:
addPropertyin 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-classeselement in thepersistence.xmlfile.- Specified by:
excludeUnlistedClassesin interfaceTapestryPersistenceUnitInfo- Parameters:
exclude- defines whether to exclude or not
-
getJarFileUrls
public java.util.List<java.net.URL> getJarFileUrls()
- Specified by:
getJarFileUrlsin interfacePersistenceUnitInfo
-
getPersistenceUnitRootUrl
public java.net.URL getPersistenceUnitRootUrl()
- Specified by:
getPersistenceUnitRootUrlin interfacePersistenceUnitInfo
-
getManagedClassNames
public java.util.List<java.lang.String> getManagedClassNames()
- Specified by:
getManagedClassNamesin interfacePersistenceUnitInfo
-
addManagedClassName
public TapestryPersistenceUnitInfo addManagedClassName(java.lang.String className)
Add a managed class name to be used by persistence provider. Corresponds to a namedclasselement in thepersistence.xmlfile.- Specified by:
addManagedClassNamein 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 namedclasselement in thepersistence.xmlfile.- Specified by:
addManagedClassin interfaceTapestryPersistenceUnitInfo- Parameters:
clazz- class to add- See Also:
TapestryPersistenceUnitInfo.addManagedClassName(String)
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()
- Specified by:
excludeUnlistedClassesin interfacePersistenceUnitInfo
-
getSharedCacheMode
public SharedCacheMode getSharedCacheMode()
- Specified by:
getSharedCacheModein 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-modeelement in thepersistence.xmlfile.- Specified by:
sharedCacheModein interfaceTapestryPersistenceUnitInfo- Parameters:
cacheMode- cache mode to set
-
getValidationMode
public ValidationMode getValidationMode()
- Specified by:
getValidationModein 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-modeelement in thepersistence.xmlfile.- Specified by:
validationModein interfaceTapestryPersistenceUnitInfo- Parameters:
validationMode- validation mode to set
-
getProperties
public java.util.Properties getProperties()
- Specified by:
getPropertiesin interfacePersistenceUnitInfo
-
getPersistenceXMLSchemaVersion
public java.lang.String getPersistenceXMLSchemaVersion()
- Specified by:
getPersistenceXMLSchemaVersionin interfacePersistenceUnitInfo
-
setPersistenceXMLSchemaVersion
public void setPersistenceXMLSchemaVersion(java.lang.String version)
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
- Specified by:
getClassLoaderin interfacePersistenceUnitInfo
-
addTransformer
public void addTransformer(ClassTransformer transformer)
- Specified by:
addTransformerin interfacePersistenceUnitInfo
-
getNewTempClassLoader
public java.lang.ClassLoader getNewTempClassLoader()
- Specified by:
getNewTempClassLoaderin interfacePersistenceUnitInfo
-
setEntityManagerProperties
public TapestryPersistenceUnitInfo setEntityManagerProperties(java.util.Map properties)
Description copied from interface:TapestryPersistenceUnitInfoPersistenceProviderallows creating anEntityManagerFactorywith a default EntityManager properties map. This operation allows contributing default properties for EntityManager.- Specified by:
setEntityManagerPropertiesin interfaceTapestryPersistenceUnitInfo- Parameters:
properties- properties to initialize EntityManagerFactory with
-
getEntityManagerProperties
public java.util.Map getEntityManagerProperties()
- Specified by:
getEntityManagerPropertiesin interfaceTapestryPersistenceUnitInfo- Returns:
- Returns the supplied EntityManagerFactory properties. Returns null if not set.
-
-