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
APersistenceUnitInfo
implementation that can be constructed by hand.- See Also:
PersistenceUnitInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PersistenceUnitInfoBean.DataSourceProvider
A functional interface indicating that its implementations can supplyDataSource
s.
-
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 newPersistenceUnitInfoBean
using as many defaults as reasonably possible.PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, Collection<? extends String> managedClassNames, Supplier<? extends PersistenceUnitInfoBean.DataSourceProvider> dataSourceProviderSupplier, Properties properties)
Creates a newPersistenceUnitInfoBean
using as many defaults as reasonably possible.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTransformer(ClassTransformer classTransformer)
boolean
excludeUnlistedClasses()
static 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)
Given aPersistence.PersistenceUnit
(a Java object representation of a<persistence-unit>
element in aMETA-INF/persistence.xml
resource), aClassLoader
for loading JPA classes and resources, aSupplier
ofClassLoader
instances for helping to implement thePersistenceUnitInfo.getNewTempClassLoader()
method, aURL
representing the persistence unit's root, aMap
of unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProvider
that can provideDataSource
instances, returns aPersistenceUnitInfoBean
representing the persistence unit in question.static 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)
Given aPersistence.PersistenceUnit
(a Java object representation of a<persistence-unit>
element in aMETA-INF/persistence.xml
resource), aClassLoader
for loading JPA classes and resources, aSupplier
ofClassLoader
instances for helping to implement thePersistenceUnitInfo.getNewTempClassLoader()
method, aURL
representing the persistence unit's root, aMap
of unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProvider
that can provideDataSource
instances, returns aPersistenceUnitInfoBean
representing the persistence unit in question.static PersistenceUnitInfoBean
fromPersistenceUnit(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.xml
resource), aURL
representing the persistence unit's root, aMap
of unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProvider
that can supplyDataSource
instances, returns aPersistenceUnitInfoBean
representing the persistence unit in question.static 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)
Given aPersistence.PersistenceUnit
(a Java object representation of a<persistence-unit>
element in aMETA-INF/persistence.xml
resource), aURL
representing the persistence unit's root, aMap
of unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aDataSourceProviderSupplier
that can supplyDataSourceProvider
instances, returns aPersistenceUnitInfoBean
representing the persistence unit in question.ClassLoader
getClassLoader()
List<URL>
getJarFileUrls()
DataSource
getJtaDataSource()
List<String>
getManagedClassNames()
List<String>
getMappingFileNames()
ClassLoader
getNewTempClassLoader()
DataSource
getNonJtaDataSource()
String
getPersistenceProviderClassName()
String
getPersistenceUnitName()
URL
getPersistenceUnitRootUrl()
String
getPersistenceXMLSchemaVersion()
Properties
getProperties()
SharedCacheMode
getSharedCacheMode()
PersistenceUnitTransactionType
getTransactionType()
ValidationMode
getValidationMode()
String
toString()
-
-
-
Constructor Detail
-
PersistenceUnitInfoBean
public PersistenceUnitInfoBean(String persistenceUnitName, URL persistenceUnitRootUrl, Collection<? extends String> managedClassNames, PersistenceUnitInfoBean.DataSourceProvider dataSourceProvider, Properties properties)
Creates a newPersistenceUnitInfoBean
using as many defaults as reasonably possible.- Parameters:
persistenceUnitName
- the name of the persistence unit thisPersistenceUnitInfoBean
represents; must not benull
persistenceUnitRootUrl
- theURL
identifying the root of the persistence unit thisPersistenceUnitInfoBean
represents; must not benull
managedClassNames
- aCollection
of fully-qualified class names identifying JPA-managed classes (such as entity classes, mapped superclasses and the like); may benull
. TheCollection
is copied and no reference to it is retained.dataSourceProvider
- aPersistenceUnitInfoBean.DataSourceProvider
capable of supplyingDataSource
instances; must not benull
properties
- aProperties
object representing the properties of the persistence unit represented by thisPersistenceUnitInfoBean
; may benull
. A reference is retained to this object.- Throws:
NullPointerException
- ifpersistenceUnitName
,persistenceUnitRootUrl
ordataSourceProvider
isnull
- 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 newPersistenceUnitInfoBean
using as many defaults as reasonably possible.- Parameters:
persistenceUnitName
- the name of the persistence unit thisPersistenceUnitInfoBean
represents; must not benull
persistenceUnitRootUrl
- theURL
identifying the root of the persistence unit thisPersistenceUnitInfoBean
represents; must not benull
managedClassNames
- aCollection
of fully-qualified class names identifying JPA-managed classes (such as entity classes, mapped superclasses and the like); may benull
. TheCollection
is copied and no reference to it is retained.dataSourceProviderSupplier
- aSupplier
capable of supplyingPersistenceUnitInfoBean.DataSourceProvider
instances; must not benull
properties
- aProperties
object representing the properties of the persistence unit represented by thisPersistenceUnitInfoBean
; may benull
. A reference is retained to this object.- Throws:
NullPointerException
- ifpersistenceUnitName
,persistenceUnitRootUrl
ordataSourceProviderSupplier
isnull
- 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 thisPersistenceUnitInfoBean
represents; must not benull
persistenceUnitRootUrl
- theURL
identifying the root of the persistence unit thisPersistenceUnitInfoBean
represents; must not benull
persistenceXMLSchemaVersion
- aString
representation of the version of JPA being supported; may benull
in which case "2.2
" will be used insteadpersistenceProviderClassName
- the fully-qualified class name of aPersistenceProvider
implementation; may benull
in which case a default will be usedclassLoader
- aClassLoader
to be returned by thegetClassLoader()
method; may benull
tempClassLoaderSupplier
- aSupplier
ofClassLoader
instances to be used by thegetNewTempClassLoader()
method; may benull
classTransformerConsumer
- aConsumer
of anyClassTransformer
s that may be added via a JPA provider's invocation of theaddTransformer(ClassTransformer)
method; may benull
in which case no action will be takenexcludeUnlistedClasses
- iftrue
, then any automatically discovered managed classes not explicitly contained inmanagedClassNames
will be excluded from considerationjarFileUrls
- aCollection
ofURL
s identifying.jar
files containing managed classes; may benull
. TheCollection
is copied and no reference to it is retained.managedClassNames
- aCollection
of fully-qualified class names identifying JPA-managed classes (such as entity classes, mapped superclasses and the like); may benull
. TheCollection
is copied and no reference to it is retained.mappingFileNames
- aCollection
of classpath resource names identifying JPA mapping files; may benull
. TheCollection
is copied and no reference to it is retained.jtaDataSourceName
- the name of a data source that may be enrolled in JTA-compliant transactions; may benull
nonJtaDataSourceName
- the name of a data source that should not be enrolled in JTA-compliant transactions; may benull
dataSourceProvider
- aPersistenceUnitInfoBean.DataSourceProvider
capable of supplyingDataSource
instances; must not benull
properties
- aProperties
object representing the properties of the persistence unit represented by thisPersistenceUnitInfoBean
; may benull
. A reference is retained to this object.sharedCacheMode
- theSharedCacheMode
thisPersistenceUnitInfoBean
will use; may benull
in which caseSharedCacheMode.UNSPECIFIED
will be used insteadtransactionType
- thePersistenceUnitTransactionType
thisPersistenceUnitInfoBean
will use; may benull
in which casePersistenceUnitTransactionType.JTA
will be used insteadvalidationMode
- theValidationMode
thisPersistenceUnitInfoBean
will use; may benull
in which caseValidationMode.AUTO
will be used instead- Throws:
NullPointerException
- ifpersistenceUnitName
,persistenceUnitRootUrl
ordataSourceProvider
isnull
- 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 thisPersistenceUnitInfoBean
represents; must not benull
persistenceUnitRootUrl
- theURL
identifying the root of the persistence unit thisPersistenceUnitInfoBean
represents; must not benull
persistenceXMLSchemaVersion
- aString
representation of the version of JPA being supported; may benull
in which case "2.2
" will be used insteadpersistenceProviderClassName
- the fully-qualified class name of aPersistenceProvider
implementation; may benull
in which case a default will be usedclassLoader
- aClassLoader
to be returned by thegetClassLoader()
method; may benull
tempClassLoaderSupplier
- aSupplier
ofClassLoader
instances to be used by thegetNewTempClassLoader()
method; may benull
classTransformerConsumer
- aConsumer
of anyClassTransformer
s that may be added via a JPA provider's invocation of theaddTransformer(ClassTransformer)
method; may benull
in which case no action will be takenexcludeUnlistedClasses
- iftrue
, then any automatically discovered managed classes not explicitly contained inmanagedClassNames
will be excluded from considerationjarFileUrls
- aCollection
ofURL
s identifying.jar
files containing managed classes; may benull
. TheCollection
is copied and no reference to it is retained.managedClassNames
- aCollection
of fully-qualified class names identifying JPA-managed classes (such as entity classes, mapped superclasses and the like); may benull
. TheCollection
is copied and no reference to it is retained.mappingFileNames
- aCollection
of classpath resource names identifying JPA mapping files; may benull
. TheCollection
is copied and no reference to it is retained.jtaDataSourceName
- the name of a data source that may be enrolled in JTA-compliant transactions; may benull
nonJtaDataSourceName
- the name of a data source that should not be enrolled in JTA-compliant transactions; may benull
dataSourceProviderSupplier
- aSupplier
capable of supplyingPersistenceUnitInfoBean.DataSourceProvider
instances; must not benull
properties
- aProperties
object representing the properties of the persistence unit represented by thisPersistenceUnitInfoBean
; may benull
. A reference is retained to this object.sharedCacheMode
- theSharedCacheMode
thisPersistenceUnitInfoBean
will use; may benull
in which caseSharedCacheMode.UNSPECIFIED
will be used insteadtransactionType
- thePersistenceUnitTransactionType
thisPersistenceUnitInfoBean
will use; may benull
in which casePersistenceUnitTransactionType.JTA
will be used insteadvalidationMode
- theValidationMode
thisPersistenceUnitInfoBean
will use; may benull
in which caseValidationMode.AUTO
will be used instead- Throws:
NullPointerException
- ifpersistenceUnitName
,persistenceUnitRootUrl
ordataSourceProvider
isnull
- 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:
getJarFileUrls
in interfacePersistenceUnitInfo
-
getPersistenceUnitRootUrl
public URL getPersistenceUnitRootUrl()
- Specified by:
getPersistenceUnitRootUrl
in interfacePersistenceUnitInfo
-
getManagedClassNames
public List<String> getManagedClassNames()
- Specified by:
getManagedClassNames
in interfacePersistenceUnitInfo
-
excludeUnlistedClasses
public boolean excludeUnlistedClasses()
- Specified by:
excludeUnlistedClasses
in interfacePersistenceUnitInfo
-
getSharedCacheMode
public SharedCacheMode getSharedCacheMode()
- Specified by:
getSharedCacheMode
in interfacePersistenceUnitInfo
-
getValidationMode
public ValidationMode getValidationMode()
- Specified by:
getValidationMode
in interfacePersistenceUnitInfo
-
getProperties
public Properties getProperties()
- Specified by:
getProperties
in interfacePersistenceUnitInfo
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfacePersistenceUnitInfo
-
getPersistenceXMLSchemaVersion
public String getPersistenceXMLSchemaVersion()
- Specified by:
getPersistenceXMLSchemaVersion
in interfacePersistenceUnitInfo
-
getNewTempClassLoader
public ClassLoader getNewTempClassLoader()
- Specified by:
getNewTempClassLoader
in interfacePersistenceUnitInfo
-
addTransformer
public void addTransformer(ClassTransformer classTransformer)
- Specified by:
addTransformer
in interfacePersistenceUnitInfo
-
getPersistenceUnitName
public String getPersistenceUnitName()
- Specified by:
getPersistenceUnitName
in interfacePersistenceUnitInfo
-
getPersistenceProviderClassName
public String getPersistenceProviderClassName()
- Specified by:
getPersistenceProviderClassName
in interfacePersistenceUnitInfo
-
getTransactionType
public PersistenceUnitTransactionType getTransactionType()
- Specified by:
getTransactionType
in interfacePersistenceUnitInfo
-
getJtaDataSource
public final DataSource getJtaDataSource()
- Specified by:
getJtaDataSource
in interfacePersistenceUnitInfo
-
getNonJtaDataSource
public final DataSource getNonJtaDataSource()
- Specified by:
getNonJtaDataSource
in interfacePersistenceUnitInfo
-
getMappingFileNames
public List<String> getMappingFileNames()
- Specified by:
getMappingFileNames
in 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.xml
resource), aURL
representing the persistence unit's root, aMap
of unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProvider
that can supplyDataSource
instances, returns aPersistenceUnitInfoBean
representing 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 benull
rootUrl
- theURL
representing the root of the persistence unit; must not benull
unlistedClasses
- aMap
of managed classes indexed by persistence unit name whose values might not be explicitly listed in the suppliedPersistence.PersistenceUnit
; may benull
dataSourceProvider
- aPersistenceUnitInfoBean.DataSourceProvider
; must not benull
- Returns:
- a non-
null
PersistenceUnitInfoBean
- Throws:
MalformedURLException
- if aURL
could not be constructedNullPointerException
- ifpersistenceUnit
,rootUrl
ordataSourceProvider
isnull
- 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.xml
resource), aURL
representing the persistence unit's root, aMap
of unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aDataSourceProviderSupplier
that can supplyDataSourceProvider
instances, returns aPersistenceUnitInfoBean
representing the persistence unit in question.This method never returns
null
.- Parameters:
persistenceUnit
- aPersistence.PersistenceUnit
; must not benull
rootUrl
- theURL
representing the root of the persistence unit; must not benull
unlistedClasses
- aMap
of managed classes indexed by persistence unit name whose values might not be explicitly listed in the suppliedPersistence.PersistenceUnit
; may benull
dataSourceProviderSupplier
- aSupplier
capable of supplyingPersistenceUnitInfoBean.DataSourceProvider
instances; must not benull
- Returns:
- a non-
null
PersistenceUnitInfoBean
- Throws:
MalformedURLException
- if aURL
could not be constructedNullPointerException
- ifpersistenceUnit
,rootUrl
ordataSourceProviderSupplier
isnull
-
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.xml
resource), aClassLoader
for loading JPA classes and resources, aSupplier
ofClassLoader
instances for helping to implement thePersistenceUnitInfo.getNewTempClassLoader()
method, aURL
representing the persistence unit's root, aMap
of unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProvider
that can provideDataSource
instances, returns aPersistenceUnitInfoBean
representing the persistence unit in question.This method never returns
null
.- Parameters:
persistenceUnit
- aPersistence.PersistenceUnit
; must not benull
classLoader
- aClassLoader
that the resultingPersistenceUnitInfoBean
will use; may benull
tempClassLoaderSupplier
- aSupplier
of aClassLoader
that will be used to implement thePersistenceUnitInfo.getNewTempClassLoader()
method; may benull
rootUrl
- theURL
representing the root of the persistence unit; must not benull
unlistedClasses
- aMap
of managed classes indexed by persistence unit name whose values might not be explicitly listed in the suppliedPersistence.PersistenceUnit
; may benull
dataSourceProvider
- aPersistenceUnitInfoBean.DataSourceProvider
; must not benull
- Returns:
- a non-
null
PersistenceUnitInfoBean
- Throws:
MalformedURLException
- if aURL
could not be constructedNullPointerException
- ifpersistenceUnit
orrootUrl
isnull
- 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.xml
resource), aClassLoader
for loading JPA classes and resources, aSupplier
ofClassLoader
instances for helping to implement thePersistenceUnitInfo.getNewTempClassLoader()
method, aURL
representing the persistence unit's root, aMap
of unlisted managed classes (entity classes, mapped superclasses and so on) indexed by persistence unit name, and aPersistenceUnitInfoBean.DataSourceProvider
that can provideDataSource
instances, returns aPersistenceUnitInfoBean
representing the persistence unit in question.This method never returns
null
.- Parameters:
persistenceUnit
- aPersistence.PersistenceUnit
; must not benull
classLoader
- aClassLoader
that the resultingPersistenceUnitInfoBean
will use; may benull
tempClassLoaderSupplier
- aSupplier
of aClassLoader
that will be used to implement thePersistenceUnitInfo.getNewTempClassLoader()
method; may benull
rootUrl
- theURL
representing the root of the persistence unit; must not benull
unlistedClasses
- aMap
of managed classes indexed by persistence unit name whose values might not be explicitly listed in the suppliedPersistence.PersistenceUnit
; may benull
dataSourceProviderSupplier
- aSupplier
ofPersistenceUnitInfoBean.DataSourceProvider
instances; must not benull
- Returns:
- a non-
null
PersistenceUnitInfoBean
- Throws:
MalformedURLException
- if aURL
could not be constructedNullPointerException
- ifpersistenceUnit
,rootUrl
ordataSourceProviderSupplier
isnull
- See Also:
Persistence.PersistenceUnit
,PersistenceUnitInfo
-
-