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 PersistenceXmlParsercreate()static PersistenceXmlParserstatic PersistenceXmlParsercreate(Map<?, ?> integration, ClassLoader providedClassLoader, ClassLoaderService providedClassLoaderService) Generic method to parse specifiedpersistence.xmlfiles 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.xmlfiles and return a Map of descriptors for all discovered persistence-units keyed by the PU name.
-
Method Details
-
create
- Returns:
- A
PersistenceXmlParserusing no settings at all.
-
create
- Parameters:
integration- The Map of integration settings- Returns:
- A
PersistenceXmlParserusing 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 inintegrationand overprovidedClassLoader.- Returns:
- A
PersistenceXmlParserusing the provided settings and classloading configuration.
-
getClassLoaderService
- Returns:
- The
ClassLoaderServiceused by this parser. Useful to retrieve URLs of persistence.xml files.
-
parse
Generic method to parse specifiedpersistence.xmlfiles and return a Map of descriptors for all discovered persistence-units keyed by the PU name.- Parameters:
persistenceXmlUrls- The URL of thepersistence.xmlfiles 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.xmlfiles and return a Map of descriptors for all discovered persistence-units keyed by the PU name.- Parameters:
persistenceXmlUrls- The URLs of thepersistence.xmlfiles to parsetransactionType- The specific PersistenceUnitTransactionType to incorporate into the persistence-unit descriptor- Returns:
- Map of persistence-unit descriptors keyed by the PU name
-