diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java b/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java index ad88d1926e..3187a3721f 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/HibernatePersistenceProvider.java @@ -18,9 +18,8 @@ import jakarta.persistence.spi.PersistenceUnitInfo; import jakarta.persistence.spi.ProviderUtil; import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; -import org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor; import org.hibernate.jpa.boot.spi.PersistenceConfigurationDescriptor; -import org.hibernate.jpa.boot.internal.PersistenceXmlParser; +import org.hibernate.jpa.boot.spi.PersistenceXmlParser; import org.hibernate.jpa.boot.spi.Bootstrap; import org.hibernate.jpa.boot.spi.EntityManagerFactoryBuilder; import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor; @@ -76,7 +75,7 @@ public class HibernatePersistenceProvider implements PersistenceProvider { log.tracef( "Attempting to obtain correct EntityManagerFactoryBuilder for persistenceUnitName : %s", persistenceUnitName ); final Map integration = wrap( properties ); - final List units; + final List units; try { units = PersistenceXmlParser.create( integration, providedClassLoader, providedClassLoaderService ) .locatePersistenceUnits(); @@ -93,7 +92,7 @@ public class HibernatePersistenceProvider implements PersistenceProvider { throw new PersistenceException( "No name provided and multiple persistence units found" ); } - for ( ParsedPersistenceXmlDescriptor persistenceUnit : units ) { + for ( PersistenceUnitDescriptor persistenceUnit : units ) { if ( log.isDebugEnabled() ) { log.debugf( "Checking persistence-unit [name=%s, explicit-provider=%s] against incoming persistence unit name [%s]", diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/Bootstrap.java b/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/Bootstrap.java index 37321ec8cb..7fb3d21b32 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/Bootstrap.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/Bootstrap.java @@ -14,7 +14,6 @@ import org.hibernate.Internal; import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; import org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor; -import org.hibernate.jpa.boot.internal.PersistenceXmlParser; import jakarta.persistence.spi.PersistenceUnitInfo; import jakarta.persistence.spi.PersistenceUnitTransactionType; diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/PersistenceXmlParser.java b/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/PersistenceXmlParser.java similarity index 81% rename from hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/PersistenceXmlParser.java rename to hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/PersistenceXmlParser.java index 45352ba52b..36ed1165dc 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/PersistenceXmlParser.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/PersistenceXmlParser.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.jpa.boot.internal; +package org.hibernate.jpa.boot.spi; import java.io.IOException; import java.io.InputStream; @@ -33,6 +33,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.internal.EntityManagerMessageLogger; import org.hibernate.internal.log.DeprecationLogger; import org.hibernate.internal.util.StringHelper; +import org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor; import org.hibernate.jpa.internal.util.ConfigurationHelper; import jakarta.persistence.PersistenceException; @@ -45,7 +46,7 @@ import static org.hibernate.internal.HEMLogging.messageLogger; * * @author Steve Ebersole */ -public class PersistenceXmlParser { +public final class PersistenceXmlParser { private static final EntityManagerMessageLogger LOG = messageLogger( PersistenceXmlParser.class ); @@ -82,7 +83,7 @@ public class PersistenceXmlParser { private final Map integration; private final ClassLoaderService classLoaderService; - protected PersistenceXmlParser(Map integration, ClassLoader providedClassLoader, + private PersistenceXmlParser(Map integration, ClassLoader providedClassLoader, ClassLoaderService providedClassLoaderService) { this.integration = integration; if ( providedClassLoaderService != null ) { @@ -108,14 +109,22 @@ public class PersistenceXmlParser { } } + /** + * @return The {@link ClassLoaderService} used by this parser. + * Useful to retrieve URLs of persistence.xml files. + */ + public ClassLoaderService getClassLoaderService() { + return classLoaderService; + } + /** * Find all persistence-units from all accessible {@code META-INF/persistence.xml} resources * * @return List of descriptors for all discovered persistence-units. */ @SuppressWarnings("removal") - public List locatePersistenceUnits() { - Map persistenceUnits = new HashMap<>(); + public List locatePersistenceUnits() { + Map persistenceUnits = new HashMap<>(); final List xmlUrls = classLoaderService.locateResources( "META-INF/persistence.xml" ); if ( xmlUrls.isEmpty() ) { LOG.unableToFindPersistenceXmlInClasspath(); @@ -127,70 +136,18 @@ public class PersistenceXmlParser { } /** - * Parse a specific {@code persistence.xml} with the assumption that it defines a single - * persistence-unit. + * 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 {@code persistence.xml} URL + * @param persistenceXmlUrl The URL of the {@code persistence.xml} to parse * - * @return The single persistence-unit descriptor + * @return Map of persistence-unit descriptors keyed by the PU name */ @SuppressWarnings("removal") - public ParsedPersistenceXmlDescriptor locateIndividualPersistenceUnit(URL persistenceXmlUrl) { - return locateIndividualPersistenceUnit( persistenceXmlUrl, PersistenceUnitTransactionType.RESOURCE_LOCAL ); - } - - /** - * Parse a specific {@code persistence.xml} with the assumption that it defines a single - * persistence-unit. - * - * @param persistenceXmlUrl The {@code persistence.xml} URL - * @param transactionType The specific PersistenceUnitTransactionType to incorporate into the persistence-unit descriptor - * - * @return The single persistence-unit descriptor - */ - public ParsedPersistenceXmlDescriptor locateIndividualPersistenceUnit( - URL persistenceXmlUrl, - @SuppressWarnings("removal") - PersistenceUnitTransactionType transactionType) { - Map persistenceUnits = new HashMap<>(); - parsePersistenceXml( persistenceUnits, persistenceXmlUrl, transactionType ); - assert persistenceUnits.size() == 1; - return persistenceUnits.values().iterator().next(); - } - - /** - * Parse a specific {@code persistence.xml} and return the descriptor for the persistence-unit with matching name - * - * @param persistenceXmlUrl The {@code persistence.xml} URL - * @param name The PU name to match - * - * @return The matching persistence-unit descriptor - */ - @SuppressWarnings("removal") - public ParsedPersistenceXmlDescriptor locateNamedPersistenceUnit(URL persistenceXmlUrl, String name) { - return locateNamedPersistenceUnit( persistenceXmlUrl, name, PersistenceUnitTransactionType.RESOURCE_LOCAL ); - } - - /** - * Parse a specific {@code persistence.xml} and return the descriptor for the persistence-unit with matching name - * - * @param persistenceXmlUrl The {@code persistence.xml} URL - * @param name The PU name to match - * @param transactionType The specific PersistenceUnitTransactionType to incorporate into the persistence-unit descriptor - * - * @return The matching persistence-unit descriptor - */ - public ParsedPersistenceXmlDescriptor locateNamedPersistenceUnit( - URL persistenceXmlUrl, - String name, - @SuppressWarnings("removal") - PersistenceUnitTransactionType transactionType) { - assert StringHelper.isNotEmpty( name ); - - Map persistenceUnits = new HashMap<>(); - parsePersistenceXml( persistenceUnits, persistenceXmlUrl, transactionType ); - assert persistenceUnits.containsKey( name ); - return persistenceUnits.get( name ); + public Map parse(URL persistenceXmlUrl) { + Map persistenceUnits = new HashMap<>(); + parsePersistenceXml( persistenceUnits, persistenceXmlUrl, PersistenceUnitTransactionType.RESOURCE_LOCAL ); + return persistenceUnits; } /** @@ -202,16 +159,16 @@ public class PersistenceXmlParser { * * @return Map of persistence-unit descriptors keyed by the PU name */ - public Map parse( + public Map parse( URL persistenceXmlUrl, @SuppressWarnings("removal") PersistenceUnitTransactionType transactionType) { - Map persistenceUnits = new HashMap<>(); + Map persistenceUnits = new HashMap<>(); parsePersistenceXml( persistenceUnits, persistenceXmlUrl, transactionType ); return persistenceUnits; } - private void parsePersistenceXml(Map persistenceUnits, + private void parsePersistenceXml(Map persistenceUnits, List xmlUrls, @SuppressWarnings("removal") PersistenceUnitTransactionType defaultTransactionType) { @@ -221,7 +178,7 @@ public class PersistenceXmlParser { } @SuppressWarnings("removal") - protected void parsePersistenceXml(Map persistenceUnits, + protected void parsePersistenceXml(Map persistenceUnits, URL xmlUrl, PersistenceUnitTransactionType defaultTransactionType) { if ( LOG.isTraceEnabled() ) { LOG.tracef( "Attempting to parse persistence.xml file : %s", xmlUrl.toExternalForm() ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/compliance/PersistenceUnitNameTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/compliance/PersistenceUnitNameTests.java index 67746952b2..b3d9a721f7 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/compliance/PersistenceUnitNameTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/compliance/PersistenceUnitNameTests.java @@ -13,10 +13,9 @@ import java.util.Map; import org.hibernate.boot.archive.scan.internal.DisabledScanner; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.JdbcSettings; -import org.hibernate.cfg.MappingSettings; import org.hibernate.engine.config.spi.ConfigurationService; -import org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor; -import org.hibernate.jpa.boot.internal.PersistenceXmlParser; +import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor; +import org.hibernate.jpa.boot.spi.PersistenceXmlParser; import org.hibernate.jpa.boot.spi.Bootstrap; import org.hibernate.jpa.boot.spi.EntityManagerFactoryBuilder; @@ -53,7 +52,9 @@ public class PersistenceUnitNameTests { private static EntityManagerFactory loadFactory(String name, ServiceRegistryScope scope) { final URL puFile = PersistenceUnitNameTests.class.getClassLoader().getResource( "xml/jakarta/simple/2units.xml" ); - final ParsedPersistenceXmlDescriptor descriptor = PersistenceXmlParser.locateNamedPersistenceUnit( puFile, name ); + var descriptors = PersistenceXmlParser.create().parse( puFile ); + assertThat( descriptors ).containsKey( name ); + final PersistenceUnitDescriptor descriptor = descriptors.get( name ); final EntityManagerFactoryBuilder emfBuilder = Bootstrap.getEntityManagerFactoryBuilder( descriptor, buildSettings( scope ) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jakarta/JakartaXmlSmokeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jakarta/JakartaXmlSmokeTests.java index 35970d6719..f14e48a516 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jakarta/JakartaXmlSmokeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jakarta/JakartaXmlSmokeTests.java @@ -9,7 +9,7 @@ package org.hibernate.orm.test.jpa.jakarta; import java.io.IOException; import java.io.InputStream; import java.net.URL; -import java.util.Collections; +import java.util.Map; import java.util.stream.Stream; import javax.xml.transform.stream.StreamSource; @@ -23,8 +23,8 @@ import org.hibernate.boot.jaxb.mapping.spi.JaxbPersistenceUnitDefaultsImpl; import org.hibernate.boot.jaxb.mapping.spi.JaxbPersistenceUnitMetadataImpl; import org.hibernate.boot.jaxb.spi.Binding; import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; -import org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor; -import org.hibernate.jpa.boot.internal.PersistenceXmlParser; +import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor; +import org.hibernate.jpa.boot.spi.PersistenceXmlParser; import org.hibernate.testing.orm.junit.ServiceRegistry; import org.hibernate.testing.orm.junit.ServiceRegistryScope; @@ -71,9 +71,12 @@ public class JakartaXmlSmokeTests { public void testLoadingPersistenceXml(ServiceRegistryScope scope) { final ClassLoaderService cls = scope.getRegistry().getService( ClassLoaderService.class ); final URL url = cls.locateResource( "xml/jakarta/simple/persistence.xml" ); - final ParsedPersistenceXmlDescriptor descriptor = PersistenceXmlParser.create() - .locateIndividualPersistenceUnit( url ); - assertThat( descriptor.getName() ).isEqualTo( "defaultpar" ); + final Map descriptors = PersistenceXmlParser.create() + .parse( url ); + String expectedPuName = "defaultpar"; + assertThat( descriptors ).containsOnlyKeys( expectedPuName ); + var descriptor = descriptors.get( expectedPuName ); + assertThat( descriptor.getName() ).isEqualTo( expectedPuName ); assertThat( descriptor.getManagedClassNames() ).contains( "org.hibernate.jpa.test.pack.defaultpar.Lighter" ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/DuplicatePersistenceUnitNameTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/DuplicatePersistenceUnitNameTest.java index a2e179d23a..5046667f64 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/DuplicatePersistenceUnitNameTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/DuplicatePersistenceUnitNameTest.java @@ -19,7 +19,7 @@ import java.util.Set; import org.hibernate.cfg.AvailableSettings; import org.hibernate.internal.CoreMessageLogger; -import org.hibernate.jpa.boot.internal.PersistenceXmlParser; +import org.hibernate.jpa.boot.spi.PersistenceXmlParser; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseUnitTestCase; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/ExcludeUnlistedClassesTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/ExcludeUnlistedClassesTest.java index 3712eaef37..1b088439cd 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/ExcludeUnlistedClassesTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/ExcludeUnlistedClassesTest.java @@ -19,8 +19,8 @@ import java.util.Map; import org.hibernate.cfg.AvailableSettings; import org.hibernate.internal.util.ConfigHelper; -import org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor; -import org.hibernate.jpa.boot.internal.PersistenceXmlParser; +import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor; +import org.hibernate.jpa.boot.spi.PersistenceXmlParser; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseUnitTestCase; import org.junit.Test; @@ -51,7 +51,7 @@ public class ExcludeUnlistedClassesTest extends BaseUnitTestCase { final Map properties = new HashMap(); properties.put( AvailableSettings.CLASSLOADERS, Arrays.asList( new TestClassLoader() ) ); - final List parsedDescriptors = PersistenceXmlParser.create( properties ) + final List parsedDescriptors = PersistenceXmlParser.create( properties ) .locatePersistenceUnits(); doTest( parsedDescriptors, "ExcludeUnlistedClassesTest1", false ); @@ -60,9 +60,9 @@ public class ExcludeUnlistedClassesTest extends BaseUnitTestCase { doTest( parsedDescriptors, "ExcludeUnlistedClassesTest4", true ); } - private void doTest(List parsedDescriptors, + private void doTest(List parsedDescriptors, final String persistenceUnitName, final boolean shouldExclude) { - for (final ParsedPersistenceXmlDescriptor descriptor : parsedDescriptors) { + for (final PersistenceUnitDescriptor descriptor : parsedDescriptors) { if (descriptor.getName().equals( persistenceUnitName )) { assertEquals(descriptor.isExcludeUnlistedClasses(), shouldExclude); return; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/PersistenceXmlParserTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/PersistenceXmlParserTest.java new file mode 100644 index 0000000000..99b39226cb --- /dev/null +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/persistenceunit/PersistenceXmlParserTest.java @@ -0,0 +1,146 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.orm.test.jpa.persistenceunit; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hibernate.internal.util.ConfigHelper.findAsResource; + +import java.io.IOException; +import java.net.URL; +import java.util.Arrays; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import java.util.Map; + +import org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl; +import org.hibernate.cfg.AvailableSettings; +import org.hibernate.internal.CoreMessageLogger; +import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor; +import org.hibernate.jpa.boot.spi.PersistenceXmlParser; + +import org.hibernate.testing.logger.LoggerInspectionRule; +import org.hibernate.testing.orm.junit.JiraKey; +import org.junit.Rule; +import org.junit.jupiter.api.Test; + +import org.jboss.logging.Logger; + +import jakarta.persistence.spi.PersistenceUnitTransactionType; + +@SuppressWarnings("removal") +@JiraKey("HHH-18231") +public class PersistenceXmlParserTest { + + @Rule + public LoggerInspectionRule logInspection = new LoggerInspectionRule( + Logger.getMessageLogger( CoreMessageLogger.class, PersistenceXmlParser.class.getName() ) + ); + + @Test + public void create_classLoaders() { + var parser = PersistenceXmlParser.create( + Map.of( AvailableSettings.CLASSLOADERS, Arrays.asList( new TestClassLoader( "pu1" ) ) ), + new TestClassLoader( "pu2" ), + null + ); + assertThat( parser.getClassLoaderService() ).isNotNull(); + assertThat( parser.locatePersistenceUnits() ) + .extracting( PersistenceUnitDescriptor::getName ) + .containsExactlyInAnyOrder( "pu1", "pu2" ); + } + + @Test + public void create_classLoaderService() { + var myClassLoaderService = new ClassLoaderServiceImpl( new TestClassLoader( "pu3" ) ); + var parser = PersistenceXmlParser.create( + // Should be ignored + Map.of( AvailableSettings.CLASSLOADERS, Arrays.asList( new TestClassLoader( "pu1" ) ) ), + // Should be ignored + new TestClassLoader( "pu2" ), + myClassLoaderService + ); + assertThat( parser.getClassLoaderService() ).isSameAs( myClassLoaderService ); + assertThat( parser.locatePersistenceUnits() ) + .extracting( PersistenceUnitDescriptor::getName ) + .containsExactlyInAnyOrder( "pu3" ); + } + + @Test + public void locatePersistenceUnits() { + var parser = PersistenceXmlParser.create( + Map.of(), + new TestClassLoader( "pu1" ), + null + ); + assertThat( parser.locatePersistenceUnits() ) + .singleElement() + .returns( "pu1", PersistenceUnitDescriptor::getName ); + } + + @Test + public void locatePersistenceUnits_empty() { + var noFileLog = logInspection.watchForLogMessages( "HHH000318" ); + var parser = PersistenceXmlParser.create(); + assertThat( parser.locatePersistenceUnits() ).isEmpty(); + assertThat( noFileLog.wasTriggered() ).isTrue(); + } + + @Test + public void parse() { + var parser = PersistenceXmlParser.create(); + var result = parser.parse( findPuResource( "multipu" ) ); + assertThat( result ) + .containsOnlyKeys( "multipu1", "multipu2", "multipu3" ); + assertThat( result.get( "multipu1" ) ) + .returns( "multipu1", PersistenceUnitDescriptor::getName ) + .returns( + PersistenceUnitTransactionType.RESOURCE_LOCAL, PersistenceUnitDescriptor::getTransactionType ); + assertThat( result.get( "multipu2" ) ) + .returns( "multipu2", PersistenceUnitDescriptor::getName ) + .returns( + PersistenceUnitTransactionType.RESOURCE_LOCAL, PersistenceUnitDescriptor::getTransactionType ); + assertThat( result.get( "multipu3" ) ) + .returns( "multipu3", PersistenceUnitDescriptor::getName ) + .returns( PersistenceUnitTransactionType.JTA, PersistenceUnitDescriptor::getTransactionType ); + } + + @Test + public void parse_defaultTransactionType() { + var parser = PersistenceXmlParser.create(); + var result = parser.parse( findPuResource( "multipu" ), PersistenceUnitTransactionType.JTA ); + assertThat( result.get( "multipu1" ) ) + .returns( "multipu1", PersistenceUnitDescriptor::getName ) + .returns( + PersistenceUnitTransactionType.JTA, PersistenceUnitDescriptor::getTransactionType ); + assertThat( result.get( "multipu2" ) ) + .returns( "multipu2", PersistenceUnitDescriptor::getName ) + .returns( PersistenceUnitTransactionType.RESOURCE_LOCAL, PersistenceUnitDescriptor::getTransactionType ); + assertThat( result.get( "multipu3" ) ) + .returns( "multipu3", PersistenceUnitDescriptor::getName ) + .returns( PersistenceUnitTransactionType.JTA, PersistenceUnitDescriptor::getTransactionType ); + } + + private static URL findPuResource(String resourceName) { + return findAsResource( "org/hibernate/jpa/test/persistenceunit/META-INF/" + resourceName + ".xml" ); + } + + private static class TestClassLoader extends ClassLoader { + private final URL url; + + public TestClassLoader(String resourceName) { + url = findPuResource( resourceName ); + } + + @Override + protected Enumeration findResources(String name) throws IOException { + return name.equals( "META-INF/persistence.xml" ) ? + Collections.enumeration( List.of( url ) ) : + Collections.emptyEnumeration(); + } + } +} diff --git a/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/multipu.xml b/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/multipu.xml new file mode 100644 index 0000000000..50f10b9565 --- /dev/null +++ b/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/multipu.xml @@ -0,0 +1,27 @@ + + + + + + org.hibernate.jpa.HibernatePersistenceProvider + org.hibernate.orm.test.jpa.persistenceunit.DataPoint + + + org.hibernate.jpa.HibernatePersistenceProvider + org.hibernate.orm.test.jpa.persistenceunit.DataPoint + + + org.hibernate.jpa.HibernatePersistenceProvider + org.hibernate.orm.test.jpa.persistenceunit.DataPoint + + + \ No newline at end of file diff --git a/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu1.xml b/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu1.xml new file mode 100644 index 0000000000..1f1d724601 --- /dev/null +++ b/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu1.xml @@ -0,0 +1,19 @@ + + + + + + org.hibernate.jpa.HibernatePersistenceProvider + org.hibernate.orm.test.jpa.persistenceunit.DataPoint + + + \ No newline at end of file diff --git a/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu2.xml b/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu2.xml new file mode 100644 index 0000000000..21dccdefcf --- /dev/null +++ b/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu2.xml @@ -0,0 +1,19 @@ + + + + + + org.hibernate.jpa.HibernatePersistenceProvider + org.hibernate.orm.test.jpa.persistenceunit.DataPoint + + + \ No newline at end of file diff --git a/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu3.xml b/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu3.xml new file mode 100644 index 0000000000..9324dba2d6 --- /dev/null +++ b/hibernate-core/src/test/resources/org/hibernate/jpa/test/persistenceunit/META-INF/pu3.xml @@ -0,0 +1,19 @@ + + + + + + org.hibernate.jpa.HibernatePersistenceProvider + org.hibernate.orm.test.jpa.persistenceunit.DataPoint + + + \ No newline at end of file