Java Code Examples for org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl#fromConfigSettings()

The following examples show how to use org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl#fromConfigSettings() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PersistenceXmlParser.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Find all persistence-units from all accessible {@code META-INF/persistence.xml} resources
 *
 * @param integration The Map of integration settings
 *
 * @return List of descriptors for all discovered persistence-units.
 */
public static List<ParsedPersistenceXmlDescriptor> locatePersistenceUnits(Map integration) {
	final PersistenceXmlParser parser = new PersistenceXmlParser(
			ClassLoaderServiceImpl.fromConfigSettings( integration ),
			PersistenceUnitTransactionType.RESOURCE_LOCAL
	);
	parser.doResolve( integration );
	return new ArrayList<>( parser.persistenceUnits.values() );
}
 
Example 2
Source File: PersistenceXmlParser.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generic method to parse a specified {@code persistence.xml} and return a Map of descriptors
 * for all discovered persistence-units keyed by the PU name.
 *
 * @param persistenceXmlUrl The URL of the {@code persistence.xml} to parse
 * @param transactionType The specific PersistenceUnitTransactionType to incorporate into the persistence-unit descriptor
 * @param integration The Map of integration settings
 *
 * @return Map of persistence-unit descriptors keyed by the PU name
 */
public static Map<String, ParsedPersistenceXmlDescriptor> parse(
		URL persistenceXmlUrl,
		PersistenceUnitTransactionType transactionType,
		Map integration) {
	PersistenceXmlParser parser = new PersistenceXmlParser(
			ClassLoaderServiceImpl.fromConfigSettings( integration ),
			transactionType
	);

	parser.doResolve( integration );
	return parser.persistenceUnits;
}