Skip to content

Commit

Permalink
HSEARCH-3277 Avoid deprecated Hibernate ORM APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Oct 6, 2022
1 parent 80fe689 commit 2053ac2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Expand Up @@ -61,7 +61,7 @@ public class QueryDslIT {
@Before
public void setup() {
entityManagerFactory = setupHelper.start()
.withProperty( AvailableSettings.JPA_SHARED_CACHE_MODE, SharedCacheMode.ENABLE_SELECTIVE.name() )
.withProperty( AvailableSettings.JAKARTA_SHARED_CACHE_MODE, SharedCacheMode.ENABLE_SELECTIVE.name() )
.setup( Book.class, Manager.class, Associate.class );
initData();
}
Expand Down
Expand Up @@ -137,7 +137,7 @@ private <T> void doTest(ExpectedScope expectedScope, CounterKeys counterKeys, Be
int expectedInstances = ExpectedScope.SINGLETON.equals( expectedScope ) ? 1 : 2;

try ( @SuppressWarnings("unused") SessionFactory sessionFactory = ormSetupHelper.start()
.withProperty( AvailableSettings.CDI_BEAN_MANAGER, cdiContainer.getBeanManager() )
.withProperty( AvailableSettings.JAKARTA_CDI_BEAN_MANAGER, cdiContainer.getBeanManager() )
.setup( IndexedEntity.class ) ) {
backendMock.verifyExpectationsMet();

Expand Down
Expand Up @@ -80,7 +80,7 @@ public void successfulBoot() {
} );

try ( @SuppressWarnings("unused") SessionFactory sessionFactory = ormSetupHelper.start()
.withProperty( AvailableSettings.CDI_BEAN_MANAGER, extendedBeanManager )
.withProperty( AvailableSettings.JAKARTA_CDI_BEAN_MANAGER, extendedBeanManager )
.setup( IndexedEntity.class ) ) {
// Hibernate Search should not have booted yet.
backendMock.verifyExpectationsMet();
Expand Down Expand Up @@ -135,7 +135,7 @@ public void failedBoot() {
} );

try ( @SuppressWarnings("unused") SessionFactory sessionFactory = ormSetupHelper.start()
.withProperty( AvailableSettings.CDI_BEAN_MANAGER, extendedBeanManager )
.withProperty( AvailableSettings.JAKARTA_CDI_BEAN_MANAGER, extendedBeanManager )
.setup( IndexedEntity.class ) ) {
// Hibernate Search should not have booted yet.
backendMock.verifyExpectationsMet();
Expand Down Expand Up @@ -189,7 +189,7 @@ public void cancelledBoot() {
} );

try ( @SuppressWarnings("unused") SessionFactory sessionFactory = ormSetupHelper.start()
.withProperty( AvailableSettings.CDI_BEAN_MANAGER, extendedBeanManager )
.withProperty( AvailableSettings.JAKARTA_CDI_BEAN_MANAGER, extendedBeanManager )
.setup( IndexedEntity.class ) ) {
// Hibernate Search should not have booted yet.
backendMock.verifyExpectationsMet();
Expand Down Expand Up @@ -230,7 +230,7 @@ public void failedShutdown() {
} );

try ( @SuppressWarnings("unused") SessionFactory sessionFactory = ormSetupHelper.start()
.withProperty( AvailableSettings.CDI_BEAN_MANAGER, extendedBeanManager )
.withProperty( AvailableSettings.JAKARTA_CDI_BEAN_MANAGER, extendedBeanManager )
.setup( IndexedEntity.class ) ) {
// Hibernate Search should not have booted yet.
backendMock.verifyExpectationsMet();
Expand Down
Expand Up @@ -57,7 +57,7 @@ public void setup(OrmSetupHelper.SetupContext setupContext) {
backendMock.expectAnySchema( IndexedEntity.NAME );

setupContext.withPropertyRadical( HibernateOrmMapperSettings.Radicals.AUTOMATIC_INDEXING_ENABLED, "false" )
.withProperty( AvailableSettings.JPA_SHARED_CACHE_MODE, SharedCacheMode.ALL.name() )
.withProperty( AvailableSettings.JAKARTA_SHARED_CACHE_MODE, SharedCacheMode.ALL.name() )
.withProperty( AvailableSettings.GENERATE_STATISTICS, "true" )
.withProperty( AvailableSettings.USE_SECOND_LEVEL_CACHE, "true" )
.withAnnotatedTypes( IndexedEntity.class );
Expand Down
Expand Up @@ -98,7 +98,7 @@ public void setup(OrmSetupHelper.SetupContext setupContext) {

setupContext.withProperty( HibernateOrmMapperSettings.QUERY_LOADING_CACHE_LOOKUP_STRATEGY,
defaultCacheLookupStrategy )
.withProperty( AvailableSettings.JPA_SHARED_CACHE_MODE, SharedCacheMode.ALL.name() )
.withProperty( AvailableSettings.JAKARTA_SHARED_CACHE_MODE, SharedCacheMode.ALL.name() )
.withConfiguration( c -> mapping.configure( c, model ) );
}

Expand Down
Expand Up @@ -117,7 +117,7 @@ public void setup(OrmSetupHelper.SetupContext setupContext) {
backendMock.expectAnySchema( Hierarchy8_A_C_Cacheable.NAME );
backendMock.expectAnySchema( Hierarchy8_A_D_Cacheable.NAME );

setupContext.withProperty( AvailableSettings.JPA_SHARED_CACHE_MODE, SharedCacheMode.ENABLE_SELECTIVE.name() )
setupContext.withProperty( AvailableSettings.JAKARTA_SHARED_CACHE_MODE, SharedCacheMode.ENABLE_SELECTIVE.name() )
.withAnnotatedTypes(
Hierarchy1_A__Abstract.class,
Hierarchy1_A_B.class,
Expand Down

0 comments on commit 2053ac2

Please sign in to comment.