Test @Jpa properties should override the default integration settings
This commit is contained in:
parent
2d2e7eb4fc
commit
d5b408e61d
|
@ -81,6 +81,10 @@ public class EntityManagerFactoryExtension
|
|||
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 class EntityManagerFactoryExtension
|
|||
|
||||
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…
Reference in New Issue