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 authored and marko-bekhta committed Sep 25, 2023
1 parent 694da2e commit 8ccb122
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private <T> void doTest(ExpectedScope expectedScope, CounterKeys counterKeys, Be

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
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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 @@ -138,7 +138,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 @@ -193,7 +193,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 @@ -235,7 +235,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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void setup(OrmSetupHelper.SetupContext setupContext) {
backendMock.expectAnySchema( IndexedEntity.NAME );

setupContext.withPropertyRadical( HibernateOrmMapperSettings.Radicals.INDEXING_LISTENERS_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
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,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
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,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 8ccb122

Please sign in to comment.