Package org.hibernate.jpa.boot.spi
Class PersistenceXmlParser
java.lang.Object
org.hibernate.jpa.boot.spi.PersistenceXmlParser
Used by Hibernate to parse
persistence.xml
files in SE environments.-
Method Summary
Modifier and TypeMethodDescriptionstatic PersistenceXmlParser
create()
static PersistenceXmlParser
static PersistenceXmlParser
create
(Map<?, ?> integration, ClassLoader providedClassLoader, ClassLoaderService providedClassLoaderService) Generic method to parse specifiedpersistence.xml
files and return a Map of descriptors for all discovered persistence-units keyed by the PU name.parse
(List<URL> persistenceXmlUrls, PersistenceUnitTransactionType transactionType) Generic method to parse specifiedpersistence.xml
files and return a Map of descriptors for all discovered persistence-units keyed by the PU name.
-
Method Details
-
create
- Returns:
- A
PersistenceXmlParser
using no settings at all.
-
create
- Parameters:
integration
- The Map of integration settings- Returns:
- A
PersistenceXmlParser
using the provided settings.
-
create
public static PersistenceXmlParser create(Map<?, ?> integration, ClassLoader providedClassLoader, ClassLoaderService providedClassLoaderService) - Parameters:
integration
- The Map of integration settingsprovidedClassLoader
- A class loader to use. Resources will be retrieved from this classloader in priority, before looking into classloaders mentioned in integration settings.providedClassLoaderService
- A class loader service to use. Takes precedence over classloading settings inintegration
and overprovidedClassLoader
.- Returns:
- A
PersistenceXmlParser
using the provided settings and classloading configuration.
-
getClassLoaderService
- Returns:
- The
ClassLoaderService
used by this parser. Useful to retrieve URLs of persistence.xml files.
-
parse
Generic method to parse specifiedpersistence.xml
files and return a Map of descriptors for all discovered persistence-units keyed by the PU name.- Parameters:
persistenceXmlUrls
- The URL of thepersistence.xml
files to parse- Returns:
- Map of persistence-unit descriptors keyed by the PU name
-
parse
public Map<String,PersistenceUnitDescriptor> parse(List<URL> persistenceXmlUrls, PersistenceUnitTransactionType transactionType) Generic method to parse specifiedpersistence.xml
files and return a Map of descriptors for all discovered persistence-units keyed by the PU name.- Parameters:
persistenceXmlUrls
- The URLs of thepersistence.xml
files to parsetransactionType
- The specific PersistenceUnitTransactionType to incorporate into the persistence-unit descriptor- Returns:
- Map of persistence-unit descriptors keyed by the PU name
-