Package io.helidon.integrations.cdi.jpa
Class PersistenceUnitInfoBean
- java.lang.Object
-
- io.helidon.integrations.cdi.jpa.PersistenceUnitInfoBean
-
- All Implemented Interfaces:
PersistenceUnitInfo
public class PersistenceUnitInfoBean extends Object implements PersistenceUnitInfo
APersistenceUnitInfoimplementation that can be constructed by hand.- See Also:
PersistenceUnitInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePersistenceUnitInfoBean.DataSourceProviderA functional interface indicating that its implementations can supplyDataSources.
-
Constructor Summary
Constructors Constructor Description PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, String persistenceXMLSchemaVersion, String persistenceProviderClassName, ClassLoader classLoader, Supplier<? extends ClassLoader> tempClassLoaderSupplier, Consumer<? super ClassTransformer> classTransformerConsumer, boolean excludeUnlistedClasses, Collection<? extends URL> jarFileUrls, Collection<? extends String> managedClassNames, Collection<? extends String> mappingFileNames, String jtaDataSourceName, String nonJtaDataSourceName, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider, Properties properties, SharedCacheMode sharedCacheMode, PersistenceUnitTransactionType transactionType, ValidationMode validationMode)Creates a newPersistenceUnitInfoBean.PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, String persistenceXMLSchemaVersion, String persistenceProviderClassName, ClassLoader classLoader, Supplier<? extends ClassLoader> tempClassLoaderSupplier, Consumer<? super ClassTransformer> classTransformerConsumer, boolean excludeUnlistedClasses, Collection<? extends URL> jarFileUrls, Collection<? extends String> managedClassNames, Collection<? extends String> mappingFileNames, String jtaDataSourceName, String nonJtaDataSourceName, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier, Properties properties, SharedCacheMode sharedCacheMode, PersistenceUnitTransactionType transactionType, ValidationMode validationMode)Creates a newPersistenceUnitInfoBean.PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, Collection<? extends String> managedClassNames, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider, Properties properties)Creates a newPersistenceUnitInfoBeanusing as many defaults as reasonably possible.PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, Collection<? extends String> managedClassNames, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier, Properties properties)Creates a newPersistenceUnitInfoBeanusing as many defaults as reasonably possible.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransformer(ClassTransformer classTransformer)booleanexcludeUnlistedClasses()static PersistenceUnitInfoBeanfromPersistenceUnit(io.helidon.integrations.cdi.jpa.jaxb.Persistence.PersistenceUnit persistenceUnit, ClassLoader classLoader, Supplier<? extends ClassLoader> tempClassLoaderSupplier, URL rootUrl, Map<? extends String,? extends Set<? extends Class<?>>> unlistedClasses, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider)Given aPersistence.PersistenceUnit(a Java object representation of a<persistence-unit>element in aMETA-INF/persistence.xmlresource), aClassLoaderfor loading JPA classes and resources, aSupplierofClassLoaderinstances for helping to implement thePersistenceUnitInfo.getNewTempClassLoader()method, aURLrepresenting the persistence unit's root, aMapof unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProviderthat can provideDataSourceinstances, returns aPersistenceUnitInfoBeanrepresenting the persistence unit in question.static PersistenceUnitInfoBeanfromPersistenceUnit(io.helidon.integrations.cdi.jpa.jaxb.Persistence.PersistenceUnit persistenceUnit, ClassLoader classLoader, Supplier<? extends ClassLoader> tempClassLoaderSupplier, URL rootUrl, Map<? extends String,? extends Set<? extends Class<?>>> unlistedClasses, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier)Given aPersistence.PersistenceUnit(a Java object representation of a<persistence-unit>element in aMETA-INF/persistence.xmlresource), aClassLoaderfor loading JPA classes and resources, aSupplierofClassLoaderinstances for helping to implement thePersistenceUnitInfo.getNewTempClassLoader()method, aURLrepresenting the persistence unit's root, aMapof unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProviderthat can provideDataSourceinstances, returns aPersistenceUnitInfoBeanrepresenting the persistence unit in question.static PersistenceUnitInfoBeanfromPersistenceUnit(io.helidon.integrations.cdi.jpa.jaxb.Persistence.PersistenceUnit persistenceUnit, URL rootUrl, Map<? extends String,? extends Set<? extends Class<?>>> unlistedClasses, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider)Given aPersistence.PersistenceUnit(a Java object representation of a<persistence-unit>element in aMETA-INF/persistence.xmlresource), aURLrepresenting the persistence unit's root, aMapof unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProviderthat can supplyDataSourceinstances, returns aPersistenceUnitInfoBeanrepresenting the persistence unit in question.static PersistenceUnitInfoBeanfromPersistenceUnit(io.helidon.integrations.cdi.jpa.jaxb.Persistence.PersistenceUnit persistenceUnit, URL rootUrl, Map<? extends String,? extends Set<? extends Class<?>>> unlistedClasses, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier)Given aPersistence.PersistenceUnit(a Java object representation of a<persistence-unit>element in aMETA-INF/persistence.xmlresource), aURLrepresenting the persistence unit's root, aMapof unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aDataSourceProviderSupplierthat can supplyDataSourceProviderinstances, returns aPersistenceUnitInfoBeanrepresenting the persistence unit in question.ClassLoadergetClassLoader()List<URL>getJarFileUrls()DataSourcegetJtaDataSource()List<String>getManagedClassNames()List<String>getMappingFileNames()ClassLoadergetNewTempClassLoader()DataSourcegetNonJtaDataSource()StringgetPersistenceProviderClassName()StringgetPersistenceUnitName()URLgetPersistenceUnitRootUrl()StringgetPersistenceXMLSchemaVersion()PropertiesgetProperties()SharedCacheModegetSharedCacheMode()PersistenceUnitTransactionTypegetTransactionType()ValidationModegetValidationMode()StringtoString()
-
-
-
Constructor Detail
-
PersistenceUnitInfoBean
public PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, Collection<? extends String> managedClassNames, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider, Properties properties)
Creates a newPersistenceUnitInfoBeanusing as many defaults as reasonably possible.- Parameters:
persistenceUnitName- the name of the persistence unit thisPersistenceUnitInfoBeanrepresents; must not benullpersistenceUnitRootUrl- theURLidentifying the root of the persistence unit thisPersistenceUnitInfoBeanrepresents; must not benullmanagedClassNames- aCollectionof fully-qualified class names identifying JPA-managed classes (such as entity classes, mapped superclasses and the like); may benull. TheCollectionis copied and no reference to it is retained.dataSourceProvider- aPersistenceUnitInfoBean.DataSourceProvidercapable of supplyingDataSourceinstances; must not benullproperties- aPropertiesobject representing the properties of the persistence unit represented by thisPersistenceUnitInfoBean; may benull. A reference is retained to this object.- Throws:
NullPointerException- ifpersistenceUnitName,persistenceUnitRootUrlordataSourceProviderisnull- See Also:
PersistenceUnitInfoBean(String, URL, String, String, ClassLoader, Supplier, Consumer, boolean, Collection, Collection, Collection, String, String, DataSourceProvider, Properties, SharedCacheMode, PersistenceUnitTransactionType, ValidationMode)
-
PersistenceUnitInfoBean
public PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, Collection<? extends String> managedClassNames, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier, Properties properties)
Creates a newPersistenceUnitInfoBeanusing as many defaults as reasonably possible.- Parameters:
persistenceUnitName- the name of the persistence unit thisPersistenceUnitInfoBeanrepresents; must not benullpersistenceUnitRootUrl- theURLidentifying the root of the persistence unit thisPersistenceUnitInfoBeanrepresents; must not benullmanagedClassNames- aCollectionof fully-qualified class names identifying JPA-managed classes (such as entity classes, mapped superclasses and the like); may benull. TheCollectionis copied and no reference to it is retained.dataSourceProviderSupplier- aSuppliercapable of supplyingPersistenceUnitInfoBean.DataSourceProviderinstances; must not benullproperties- aPropertiesobject representing the properties of the persistence unit represented by thisPersistenceUnitInfoBean; may benull. A reference is retained to this object.- Throws:
NullPointerException- ifpersistenceUnitName,persistenceUnitRootUrlordataSourceProviderSupplierisnull- See Also:
PersistenceUnitInfoBean(String, URL, String, String, ClassLoader, Supplier, Consumer, boolean, Collection, Collection, Collection, String, String, DataSourceProvider, Properties, SharedCacheMode, PersistenceUnitTransactionType, ValidationMode)
-
PersistenceUnitInfoBean
public PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, String persistenceXMLSchemaVersion, String persistenceProviderClassName, ClassLoader classLoader, Supplier<? extends ClassLoader> tempClassLoaderSupplier, Consumer<? super ClassTransformer> classTransformerConsumer, boolean excludeUnlistedClasses, Collection<? extends URL> jarFileUrls, Collection<? extends String> managedClassNames, Collection<? extends String> mappingFileNames, String jtaDataSourceName, String nonJtaDataSourceName, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider, Properties properties, SharedCacheMode sharedCacheMode, PersistenceUnitTransactionType transactionType, ValidationMode validationMode)
Creates a newPersistenceUnitInfoBean.- Parameters:
persistenceUnitName- the name of the persistence unit thisPersistenceUnitInfoBeanrepresents; must not benullpersistenceUnitRootUrl- theURLidentifying the root of the persistence unit thisPersistenceUnitInfoBeanrepresents; must not benullpersistenceXMLSchemaVersion- aStringrepresentation of the version of JPA being supported; may benullin which case "2.2" will be used insteadpersistenceProviderClassName- the fully-qualified class name of aPersistenceProviderimplementation; may benullin which case a default will be usedclassLoader- aClassLoaderto be returned by thegetClassLoader()method; may benulltempClassLoaderSupplier- aSupplierofClassLoaderinstances to be used by thegetNewTempClassLoader()method; may benullclassTransformerConsumer- aConsumerof anyClassTransformers that may be added via a JPA provider's invocation of theaddTransformer(ClassTransformer)method; may benullin which case no action will be takenexcludeUnlistedClasses- iftrue, then any automatically discovered managed classes not explicitly contained inmanagedClassNameswill be excluded from considerationjarFileUrls- aCollectionofURLs identifying.jarfiles containing managed classes; may benull. TheCollectionis copied and no reference to it is retained.managedClassNames- aCollectionof fully-qualified class names identifying JPA-managed classes (such as entity classes, mapped superclasses and the like); may benull. TheCollectionis copied and no reference to it is retained.mappingFileNames- aCollectionof classpath resource names identifying JPA mapping files; may benull. TheCollectionis copied and no reference to it is retained.jtaDataSourceName- the name of a data source that may be enrolled in JTA-compliant transactions; may benullnonJtaDataSourceName- the name of a data source that should not be enrolled in JTA-compliant transactions; may benulldataSourceProvider- aPersistenceUnitInfoBean.DataSourceProvidercapable of supplyingDataSourceinstances; must not benullproperties- aPropertiesobject representing the properties of the persistence unit represented by thisPersistenceUnitInfoBean; may benull. A reference is retained to this object.sharedCacheMode- theSharedCacheModethisPersistenceUnitInfoBeanwill use; may benullin which caseSharedCacheMode.UNSPECIFIEDwill be used insteadtransactionType- thePersistenceUnitTransactionTypethisPersistenceUnitInfoBeanwill use; may benullin which casePersistenceUnitTransactionType.JTAwill be used insteadvalidationMode- theValidationModethisPersistenceUnitInfoBeanwill use; may benullin which caseValidationMode.AUTOwill be used instead- Throws:
NullPointerException- ifpersistenceUnitName,persistenceUnitRootUrlordataSourceProviderisnull- See Also:
getPersistenceUnitName(),getPersistenceUnitRootUrl(),getPersistenceXMLSchemaVersion(),getPersistenceProviderClassName(),getClassLoader(),getNewTempClassLoader(),excludeUnlistedClasses(),getJarFileUrls(),getManagedClassNames(),getMappingFileNames(),getJtaDataSource(),getNonJtaDataSource(),getProperties(),getSharedCacheMode(),getTransactionType(),getValidationMode()
-
PersistenceUnitInfoBean
public PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, String persistenceXMLSchemaVersion, String persistenceProviderClassName, ClassLoader classLoader, Supplier<? extends ClassLoader> tempClassLoaderSupplier, Consumer<? super ClassTransformer> classTransformerConsumer, boolean excludeUnlistedClasses, Collection<? extends URL> jarFileUrls, Collection<? extends String> managedClassNames, Collection<? extends String> mappingFileNames, String jtaDataSourceName, String nonJtaDataSourceName, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier, Properties properties, SharedCacheMode sharedCacheMode, PersistenceUnitTransactionType transactionType, ValidationMode validationMode)
Creates a newPersistenceUnitInfoBean.- Parameters:
persistenceUnitName- the name of the persistence unit thisPersistenceUnitInfoBeanrepresents; must not benullpersistenceUnitRootUrl- theURLidentifying the root of the persistence unit thisPersistenceUnitInfoBeanrepresents; must not benullpersistenceXMLSchemaVersion- aStringrepresentation of the version of JPA being supported; may benullin which case "2.2" will be used insteadpersistenceProviderClassName- the fully-qualified class name of aPersistenceProviderimplementation; may benullin which case a default will be usedclassLoader- aClassLoaderto be returned by thegetClassLoader()method; may benulltempClassLoaderSupplier- aSupplierofClassLoaderinstances to be used by thegetNewTempClassLoader()method; may benullclassTransformerConsumer- aConsumerof anyClassTransformers that may be added via a JPA provider's invocation of theaddTransformer(ClassTransformer)method; may benullin which case no action will be takenexcludeUnlistedClasses- iftrue, then any automatically discovered managed classes not explicitly contained inmanagedClassNameswill be excluded from considerationjarFileUrls- aCollectionofURLs identifying.jarfiles containing managed classes; may benull. TheCollectionis copied and no reference to it is retained.managedClassNames- aCollectionof fully-qualified class names identifying JPA-managed classes (such as entity classes, mapped superclasses and the like); may benull. TheCollectionis copied and no reference to it is retained.mappingFileNames- aCollectionof classpath resource names identifying JPA mapping files; may benull. TheCollectionis copied and no reference to it is retained.jtaDataSourceName- the name of a data source that may be enrolled in JTA-compliant transactions; may benullnonJtaDataSourceName- the name of a data source that should not be enrolled in JTA-compliant transactions; may benulldataSourceProviderSupplier- aSuppliercapable of supplyingPersistenceUnitInfoBean.DataSourceProviderinstances; must not benullproperties- aPropertiesobject representing the properties of the persistence unit represented by thisPersistenceUnitInfoBean; may benull. A reference is retained to this object.sharedCacheMode- theSharedCacheModethisPersistenceUnitInfoBeanwill use; may benullin which caseSharedCacheMode.UNSPECIFIEDwill be used insteadtransactionType- thePersistenceUnitTransactionTypethisPersistenceUnitInfoBeanwill use; may benullin which casePersistenceUnitTransactionType.JTAwill be used insteadvalidationMode- theValidationModethisPersistenceUnitInfoBeanwill use; may benullin which caseValidationMode.AUTOwill be used instead- Throws:
NullPointerException- ifpersistenceUnitName,persistenceUnitRootUrlordataSourceProviderisnull- See Also:
getPersistenceUnitName(),getPersistenceUnitRootUrl(),getPersistenceXMLSchemaVersion(),getPersistenceProviderClassName(),getClassLoader(),getNewTempClassLoader(),excludeUnlistedClasses(),getJarFileUrls(),getManagedClassNames(),getMappingFileNames(),getJtaDataSource(),getNonJtaDataSource(),getProperties(),getSharedCacheMode(),getTransactionType(),getValidationMode()
-
-
Method Detail
-
getJarFileUrls
public List<URL> getJarFileUrls()
- Specified by:
getJarFileUrlsin interfacePersistenceUnitInfo
-
getPersistenceUnitRootUrl
public URL getPersistenceUnitRootUrl()
- Specified by:
getPersistenceUnitRootUrlin interfacePersistenceUnitInfo
-
getManagedClassNames
public List<String> getManagedClassNames()
- Specified by:
getManagedClassNamesin interfacePersistenceUnitInfo
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()
- Specified by:
excludeUnlistedClassesin interfacePersistenceUnitInfo
-
getSharedCacheMode
public SharedCacheMode getSharedCacheMode()
- Specified by:
getSharedCacheModein interfacePersistenceUnitInfo
-
getValidationMode
public ValidationMode getValidationMode()
- Specified by:
getValidationModein interfacePersistenceUnitInfo
-
getProperties
public Properties getProperties()
- Specified by:
getPropertiesin interfacePersistenceUnitInfo
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoaderin interfacePersistenceUnitInfo
-
getPersistenceXMLSchemaVersion
public String getPersistenceXMLSchemaVersion()
- Specified by:
getPersistenceXMLSchemaVersionin interfacePersistenceUnitInfo
-
getNewTempClassLoader
public ClassLoader getNewTempClassLoader()
- Specified by:
getNewTempClassLoaderin interfacePersistenceUnitInfo
-
addTransformer
public void addTransformer(ClassTransformer classTransformer)
- Specified by:
addTransformerin interfacePersistenceUnitInfo
-
getPersistenceUnitName
public String getPersistenceUnitName()
- Specified by:
getPersistenceUnitNamein interfacePersistenceUnitInfo
-
getPersistenceProviderClassName
public String getPersistenceProviderClassName()
- Specified by:
getPersistenceProviderClassNamein interfacePersistenceUnitInfo
-
getTransactionType
public PersistenceUnitTransactionType getTransactionType()
- Specified by:
getTransactionTypein interfacePersistenceUnitInfo
-
getJtaDataSource
public final DataSource getJtaDataSource()
- Specified by:
getJtaDataSourcein interfacePersistenceUnitInfo
-
getNonJtaDataSource
public final DataSource getNonJtaDataSource()
- Specified by:
getNonJtaDataSourcein interfacePersistenceUnitInfo
-
getMappingFileNames
public List<String> getMappingFileNames()
- Specified by:
getMappingFileNamesin interfacePersistenceUnitInfo
-
fromPersistenceUnit
public static final PersistenceUnitInfoBean fromPersistenceUnit(io.helidon.integrations.cdi.jpa.jaxb.Persistence.PersistenceUnit persistenceUnit, URL rootUrl, Map<? extends String,? extends Set<? extends Class<?>>> unlistedClasses, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider) throws MalformedURLException
Given aPersistence.PersistenceUnit(a Java object representation of a<persistence-unit>element in aMETA-INF/persistence.xmlresource), aURLrepresenting the persistence unit's root, aMapof unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProviderthat can supplyDataSourceinstances, returns aPersistenceUnitInfoBeanrepresenting the persistence unit in question.This method never returns
null.This method calls the
fromPersistenceUnit(Persistence.PersistenceUnit, ClassLoader, Supplier, URL, Map, DataSourceProvider)method using the return value of theThread.getContextClassLoader()method as theClassLoader.- Parameters:
persistenceUnit- aPersistence.PersistenceUnit; must not benullrootUrl- theURLrepresenting the root of the persistence unit; must not benullunlistedClasses- aMapof managed classes indexed by persistence unit name whose values might not be explicitly listed in the suppliedPersistence.PersistenceUnit; may benulldataSourceProvider- aPersistenceUnitInfoBean.DataSourceProvider; must not benull- Returns:
- a non-
nullPersistenceUnitInfoBean - Throws:
MalformedURLException- if aURLcould not be constructedNullPointerException- ifpersistenceUnit,rootUrlordataSourceProviderisnull- See Also:
fromPersistenceUnit(Persistence.PersistenceUnit, ClassLoader, Supplier, URL, Map, DataSourceProvider),Persistence.PersistenceUnit,PersistenceUnitInfo
-
fromPersistenceUnit
public static final PersistenceUnitInfoBean fromPersistenceUnit(io.helidon.integrations.cdi.jpa.jaxb.Persistence.PersistenceUnit persistenceUnit, URL rootUrl, Map<? extends String,? extends Set<? extends Class<?>>> unlistedClasses, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier) throws MalformedURLException
Given aPersistence.PersistenceUnit(a Java object representation of a<persistence-unit>element in aMETA-INF/persistence.xmlresource), aURLrepresenting the persistence unit's root, aMapof unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aDataSourceProviderSupplierthat can supplyDataSourceProviderinstances, returns aPersistenceUnitInfoBeanrepresenting the persistence unit in question.This method never returns
null.- Parameters:
persistenceUnit- aPersistence.PersistenceUnit; must not benullrootUrl- theURLrepresenting the root of the persistence unit; must not benullunlistedClasses- aMapof managed classes indexed by persistence unit name whose values might not be explicitly listed in the suppliedPersistence.PersistenceUnit; may benulldataSourceProviderSupplier- aSuppliercapable of supplyingPersistenceUnitInfoBean.DataSourceProviderinstances; must not benull- Returns:
- a non-
nullPersistenceUnitInfoBean - Throws:
MalformedURLException- if aURLcould not be constructedNullPointerException- ifpersistenceUnit,rootUrlordataSourceProviderSupplierisnull
-
fromPersistenceUnit
public static final PersistenceUnitInfoBean fromPersistenceUnit(io.helidon.integrations.cdi.jpa.jaxb.Persistence.PersistenceUnit persistenceUnit, ClassLoader classLoader, Supplier<? extends ClassLoader> tempClassLoaderSupplier, URL rootUrl, Map<? extends String,? extends Set<? extends Class<?>>> unlistedClasses, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider) throws MalformedURLException
Given aPersistence.PersistenceUnit(a Java object representation of a<persistence-unit>element in aMETA-INF/persistence.xmlresource), aClassLoaderfor loading JPA classes and resources, aSupplierofClassLoaderinstances for helping to implement thePersistenceUnitInfo.getNewTempClassLoader()method, aURLrepresenting the persistence unit's root, aMapof unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProviderthat can provideDataSourceinstances, returns aPersistenceUnitInfoBeanrepresenting the persistence unit in question.This method never returns
null.- Parameters:
persistenceUnit- aPersistence.PersistenceUnit; must not benullclassLoader- aClassLoaderthat the resultingPersistenceUnitInfoBeanwill use; may benulltempClassLoaderSupplier- aSupplierof aClassLoaderthat will be used to implement thePersistenceUnitInfo.getNewTempClassLoader()method; may benullrootUrl- theURLrepresenting the root of the persistence unit; must not benullunlistedClasses- aMapof managed classes indexed by persistence unit name whose values might not be explicitly listed in the suppliedPersistence.PersistenceUnit; may benulldataSourceProvider- aPersistenceUnitInfoBean.DataSourceProvider; must not benull- Returns:
- a non-
nullPersistenceUnitInfoBean - Throws:
MalformedURLException- if aURLcould not be constructedNullPointerException- ifpersistenceUnitorrootUrlisnull- See Also:
Persistence.PersistenceUnit,PersistenceUnitInfo
-
fromPersistenceUnit
public static final PersistenceUnitInfoBean fromPersistenceUnit(io.helidon.integrations.cdi.jpa.jaxb.Persistence.PersistenceUnit persistenceUnit, ClassLoader classLoader, Supplier<? extends ClassLoader> tempClassLoaderSupplier, URL rootUrl, Map<? extends String,? extends Set<? extends Class<?>>> unlistedClasses, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier) throws MalformedURLException
Given aPersistence.PersistenceUnit(a Java object representation of a<persistence-unit>element in aMETA-INF/persistence.xmlresource), aClassLoaderfor loading JPA classes and resources, aSupplierofClassLoaderinstances for helping to implement thePersistenceUnitInfo.getNewTempClassLoader()method, aURLrepresenting the persistence unit's root, aMapof unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProviderthat can provideDataSourceinstances, returns aPersistenceUnitInfoBeanrepresenting the persistence unit in question.This method never returns
null.- Parameters:
persistenceUnit- aPersistence.PersistenceUnit; must not benullclassLoader- aClassLoaderthat the resultingPersistenceUnitInfoBeanwill use; may benulltempClassLoaderSupplier- aSupplierof aClassLoaderthat will be used to implement thePersistenceUnitInfo.getNewTempClassLoader()method; may benullrootUrl- theURLrepresenting the root of the persistence unit; must not benullunlistedClasses- aMapof managed classes indexed by persistence unit name whose values might not be explicitly listed in the suppliedPersistence.PersistenceUnit; may benulldataSourceProviderSupplier- aSupplierofPersistenceUnitInfoBean.DataSourceProviderinstances; must not benull- Returns:
- a non-
nullPersistenceUnitInfoBean - Throws:
MalformedURLException- if aURLcould not be constructedNullPointerException- ifpersistenceUnit,rootUrlordataSourceProviderSupplierisnull- See Also:
Persistence.PersistenceUnit,PersistenceUnitInfo
-
-