mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-07 03:38:16 +00:00
Test @Jpa properties should override the default integration settings
This commit is contained in:
parent
2d2e7eb4fc
commit
d5b408e61d
@ -81,6 +81,10 @@ public static EntityManagerFactoryScope findEntityManagerFactoryScope(
|
||||
final Jpa emfAnn = emfAnnWrapper.orElseThrow( () -> new RuntimeException( "Could not locate @EntityManagerFactory" ) );
|
||||
|
||||
final PersistenceUnitInfoImpl pui = new PersistenceUnitInfoImpl( emfAnn.persistenceUnitName() );
|
||||
( (Map<Object, Object>) Environment.getProperties() ).forEach(
|
||||
(key, value) ->
|
||||
pui.getProperties().put( key, value )
|
||||
);
|
||||
|
||||
pui.setTransactionType( emfAnn.transactionType() );
|
||||
pui.setCacheMode( emfAnn.sharedCacheMode() );
|
||||
@ -159,10 +163,7 @@ public static EntityManagerFactoryScope findEntityManagerFactoryScope(
|
||||
|
||||
final Map<String, Object> integrationSettings = new HashMap<>();
|
||||
|
||||
( (Map<Object, Object>) Environment.getProperties() ).forEach(
|
||||
(key, value) ->
|
||||
integrationSettings.put( (String) key, value )
|
||||
);
|
||||
|
||||
|
||||
integrationSettings.put( GlobalTemporaryTableMutationStrategy.DROP_ID_TABLES, "true" );
|
||||
integrationSettings.put( LocalTemporaryTableMutationStrategy.DROP_ID_TABLES, "true" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user