Skip to content

Commit

Permalink
HHH-18003 - Create a PersistenceUnitDescriptor wrapper around JPA 3.2…
Browse files Browse the repository at this point in the history
… PersistenceConfiguration
  • Loading branch information
sebersole committed Apr 30, 2024
1 parent bb875a2 commit 74fe84f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public class PersistenceConfigurationTests {
@Test
void test1() {
final PersistenceConfiguration configuration = new PersistenceConfiguration( "tst1" )
.property( SchemaToolingSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE );
for ( Class<?> annotatedClass : StandardDomainModel.RETAIL.getDescriptor().getAnnotatedClasses() ) {
.property( SchemaToolingSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP );
for ( Class<?> annotatedClass : StandardDomainModel.CONTACTS.getDescriptor().getAnnotatedClasses() ) {
configuration.managedClass( annotatedClass );
}
try (EntityManagerFactory entityManagerFactory = new HibernatePersistenceProvider().createEntityManagerFactory( configuration )) {
entityManagerFactory.runInTransaction( entityManager -> {
entityManager.createQuery( "from Order" ).getResultList();
entityManager.createQuery( "from Contact" ).getResultList();
} );
}
}
Expand Down

0 comments on commit 74fe84f

Please sign in to comment.