Package org.hibernate.jpa.boot.internal
Class PersistenceXmlParser
- java.lang.Object
-
- org.hibernate.jpa.boot.internal.PersistenceXmlParser
-
public class PersistenceXmlParser extends Object
Used by Hibernate to parsepersistence.xml
files in SE environments.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PersistenceXmlParser.ErrorHandlerImpl
-
Constructor Summary
Constructors Modifier Constructor Description protected
PersistenceXmlParser(ClassLoaderService classLoaderService, PersistenceUnitTransactionType defaultTransactionType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<ParsedPersistenceXmlDescriptor>
getResolvedPersistenceUnits()
static ParsedPersistenceXmlDescriptor
locateIndividualPersistenceUnit(URL persistenceXmlUrl)
Parse a specificpersistence.xml
with the assumption that it defines a single persistence-unit.static ParsedPersistenceXmlDescriptor
locateIndividualPersistenceUnit(URL persistenceXmlUrl, PersistenceUnitTransactionType transactionType, Map integration)
Parse a specificpersistence.xml
with the assumption that it defines a single persistence-unit.static ParsedPersistenceXmlDescriptor
locateIndividualPersistenceUnit(URL persistenceXmlUrl, Map integration)
Parse a specificpersistence.xml
with the assumption that it defines a single persistence-unit.static ParsedPersistenceXmlDescriptor
locateNamedPersistenceUnit(URL persistenceXmlUrl, String name)
Parse a specificpersistence.xml
and return the descriptor for the persistence-unit with matching namestatic ParsedPersistenceXmlDescriptor
locateNamedPersistenceUnit(URL persistenceXmlUrl, String name, PersistenceUnitTransactionType transactionType, Map integration)
Parse a specificpersistence.xml
and return the descriptor for the persistence-unit with matching namestatic ParsedPersistenceXmlDescriptor
locateNamedPersistenceUnit(URL persistenceXmlUrl, String name, Map integration)
Parse a specificpersistence.xml
and return the descriptor for the persistence-unit with matching namestatic List<ParsedPersistenceXmlDescriptor>
locatePersistenceUnits(Map integration)
Find all persistence-units from all accessibleMETA-INF/persistence.xml
resourcesstatic Map<String,ParsedPersistenceXmlDescriptor>
parse(URL persistenceXmlUrl, PersistenceUnitTransactionType transactionType)
Intended only for use by Hibernate tests!static Map<String,ParsedPersistenceXmlDescriptor>
parse(URL persistenceXmlUrl, PersistenceUnitTransactionType transactionType, Map integration)
Generic method to parse a specifiedpersistence.xml
and return a Map of descriptors for all discovered persistence-units keyed by the PU name.protected void
parsePersistenceXml(URL xmlUrl, Map integration)
-
-
-
Constructor Detail
-
PersistenceXmlParser
protected PersistenceXmlParser(ClassLoaderService classLoaderService, PersistenceUnitTransactionType defaultTransactionType)
-
-
Method Detail
-
locatePersistenceUnits
public static List<ParsedPersistenceXmlDescriptor> locatePersistenceUnits(Map integration)
Find all persistence-units from all accessibleMETA-INF/persistence.xml
resources- Parameters:
integration
- The Map of integration settings- Returns:
- List of descriptors for all discovered persistence-units.
-
locateIndividualPersistenceUnit
public static ParsedPersistenceXmlDescriptor locateIndividualPersistenceUnit(URL persistenceXmlUrl)
Parse a specificpersistence.xml
with the assumption that it defines a single persistence-unit.- Parameters:
persistenceXmlUrl
- Thepersistence.xml
URL- Returns:
- The single persistence-unit descriptor
-
locateIndividualPersistenceUnit
public static ParsedPersistenceXmlDescriptor locateIndividualPersistenceUnit(URL persistenceXmlUrl, Map integration)
Parse a specificpersistence.xml
with the assumption that it defines a single persistence-unit.- Parameters:
persistenceXmlUrl
- Thepersistence.xml
URLintegration
- The Map of integration settings- Returns:
- The single persistence-unit descriptor
-
locateIndividualPersistenceUnit
public static ParsedPersistenceXmlDescriptor locateIndividualPersistenceUnit(URL persistenceXmlUrl, PersistenceUnitTransactionType transactionType, Map integration)
Parse a specificpersistence.xml
with the assumption that it defines a single persistence-unit.- Parameters:
persistenceXmlUrl
- Thepersistence.xml
URLtransactionType
- The specific PersistenceUnitTransactionType to incorporate into the persistence-unit descriptorintegration
- The Map of integration settings- Returns:
- The single persistence-unit descriptor
-
locateNamedPersistenceUnit
public static ParsedPersistenceXmlDescriptor locateNamedPersistenceUnit(URL persistenceXmlUrl, String name)
Parse a specificpersistence.xml
and return the descriptor for the persistence-unit with matching name- Parameters:
persistenceXmlUrl
- Thepersistence.xml
URLname
- The PU name to match- Returns:
- The matching persistence-unit descriptor
-
locateNamedPersistenceUnit
public static ParsedPersistenceXmlDescriptor locateNamedPersistenceUnit(URL persistenceXmlUrl, String name, Map integration)
Parse a specificpersistence.xml
and return the descriptor for the persistence-unit with matching name- Parameters:
persistenceXmlUrl
- Thepersistence.xml
URLname
- The PU name to matchintegration
- The Map of integration settings- Returns:
- The matching persistence-unit descriptor
-
locateNamedPersistenceUnit
public static ParsedPersistenceXmlDescriptor locateNamedPersistenceUnit(URL persistenceXmlUrl, String name, PersistenceUnitTransactionType transactionType, Map integration)
Parse a specificpersistence.xml
and return the descriptor for the persistence-unit with matching name- Parameters:
persistenceXmlUrl
- Thepersistence.xml
URLname
- The PU name to matchtransactionType
- The specific PersistenceUnitTransactionType to incorporate into the persistence-unit descriptorintegration
- The Map of integration settings- Returns:
- The matching persistence-unit descriptor
-
parse
public static Map<String,ParsedPersistenceXmlDescriptor> parse(URL persistenceXmlUrl, PersistenceUnitTransactionType transactionType)
Intended only for use by Hibernate tests!Parses a specific persistence.xml file...
-
parse
public static Map<String,ParsedPersistenceXmlDescriptor> parse(URL persistenceXmlUrl, PersistenceUnitTransactionType transactionType, Map integration)
Generic method to parse a specifiedpersistence.xml
and return a Map of descriptors for all discovered persistence-units keyed by the PU name.- Parameters:
persistenceXmlUrl
- The URL of thepersistence.xml
to parsetransactionType
- The specific PersistenceUnitTransactionType to incorporate into the persistence-unit descriptorintegration
- The Map of integration settings- Returns:
- Map of persistence-unit descriptors keyed by the PU name
-
getResolvedPersistenceUnits
protected List<ParsedPersistenceXmlDescriptor> getResolvedPersistenceUnits()
-
-