Package org.hibernate.jpa.boot.internal
Class PersistenceXmlParser
java.lang.Object
org.hibernate.jpa.boot.internal.PersistenceXmlParser
Used by Hibernate to parse
persistence.xml files in SE environments.- Author:
- Steve Ebersole
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPersistenceXmlParser(ClassLoaderService classLoaderService, PersistenceUnitTransactionType defaultTransactionType) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ParsedPersistenceXmlDescriptor>locateIndividualPersistenceUnit(URL persistenceXmlUrl) Parse a specificpersistence.xmlwith the assumption that it defines a single persistence-unit.locateIndividualPersistenceUnit(URL persistenceXmlUrl, PersistenceUnitTransactionType transactionType, Map integration) Parse a specificpersistence.xmlwith the assumption that it defines a single persistence-unit.locateIndividualPersistenceUnit(URL persistenceXmlUrl, Map integration) Parse a specificpersistence.xmlwith the assumption that it defines a single persistence-unit.locateNamedPersistenceUnit(URL persistenceXmlUrl, String name) Parse a specificpersistence.xmland return the descriptor for the persistence-unit with matching namelocateNamedPersistenceUnit(URL persistenceXmlUrl, String name, PersistenceUnitTransactionType transactionType, Map integration) Parse a specificpersistence.xmland return the descriptor for the persistence-unit with matching namelocateNamedPersistenceUnit(URL persistenceXmlUrl, String name, Map integration) Parse a specificpersistence.xmland return the descriptor for the persistence-unit with matching namestatic List<ParsedPersistenceXmlDescriptor>locatePersistenceUnits(Map integration) Find all persistence-units from all accessibleMETA-INF/persistence.xmlresourcesstatic 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.xmland return a Map of descriptors for all discovered persistence-units keyed by the PU name.protected voidparsePersistenceXml(URL xmlUrl, Map integration)
-
Constructor Details
-
PersistenceXmlParser
protected PersistenceXmlParser(ClassLoaderService classLoaderService, PersistenceUnitTransactionType defaultTransactionType)
-
-
Method Details
-
locatePersistenceUnits
Find all persistence-units from all accessibleMETA-INF/persistence.xmlresources- Parameters:
integration- The Map of integration settings- Returns:
- List of descriptors for all discovered persistence-units.
-
locateIndividualPersistenceUnit
Parse a specificpersistence.xmlwith the assumption that it defines a single persistence-unit.- Parameters:
persistenceXmlUrl- Thepersistence.xmlURL- Returns:
- The single persistence-unit descriptor
-
locateIndividualPersistenceUnit
public static ParsedPersistenceXmlDescriptor locateIndividualPersistenceUnit(URL persistenceXmlUrl, Map integration) Parse a specificpersistence.xmlwith the assumption that it defines a single persistence-unit.- Parameters:
persistenceXmlUrl- Thepersistence.xmlURLintegration- 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.xmlwith the assumption that it defines a single persistence-unit.- Parameters:
persistenceXmlUrl- Thepersistence.xmlURLtransactionType- 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.xmland return the descriptor for the persistence-unit with matching name- Parameters:
persistenceXmlUrl- Thepersistence.xmlURLname- 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.xmland return the descriptor for the persistence-unit with matching name- Parameters:
persistenceXmlUrl- Thepersistence.xmlURLname- 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.xmland return the descriptor for the persistence-unit with matching name- Parameters:
persistenceXmlUrl- Thepersistence.xmlURLname- 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.xmland return a Map of descriptors for all discovered persistence-units keyed by the PU name.- Parameters:
persistenceXmlUrl- The URL of thepersistence.xmlto 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
-
parsePersistenceXml
-