From 5149e59170dd832996a76090311c4cbad83f6682 Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Thu, 6 Apr 2023 12:12:56 +0200 Subject: [PATCH] HSEARCH-1383 Don't accept interfaces and allow mapped superclasses --- ...utboxPollingAutomaticIndexingFilterIT.java | 4 +- .../AbstractAutomaticIndexingFilterIT.java | 115 ++++++++++++++- .../SessionAutomaticIndexingFilterIT.java | 139 ++++++++++++++++++ ...OrmAutomaticIndexingTypeFilterContext.java | 11 +- .../HibernateOrmTypeContextContainer.java | 29 ++++ ...IndexingTypeFilterTypeContextProvider.java | 19 +++ ...ibernateOrmSessionTypeContextProvider.java | 3 +- orm6/mapper/orm/ant-src-changes.patch | 15 +- 8 files changed, 324 insertions(+), 11 deletions(-) create mode 100644 mapper/orm/src/main/java/org/hibernate/search/mapper/orm/session/impl/HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider.java diff --git a/integrationtest/mapper/orm-coordination-outbox-polling/src/test/java/org/hibernate/search/integrationtest/mapper/orm/coordination/outboxpolling/automaticindexing/OutboxPollingAutomaticIndexingFilterIT.java b/integrationtest/mapper/orm-coordination-outbox-polling/src/test/java/org/hibernate/search/integrationtest/mapper/orm/coordination/outboxpolling/automaticindexing/OutboxPollingAutomaticIndexingFilterIT.java index d9826593603..3a3564798bb 100644 --- a/integrationtest/mapper/orm-coordination-outbox-polling/src/test/java/org/hibernate/search/integrationtest/mapper/orm/coordination/outboxpolling/automaticindexing/OutboxPollingAutomaticIndexingFilterIT.java +++ b/integrationtest/mapper/orm-coordination-outbox-polling/src/test/java/org/hibernate/search/integrationtest/mapper/orm/coordination/outboxpolling/automaticindexing/OutboxPollingAutomaticIndexingFilterIT.java @@ -69,7 +69,7 @@ public void partialSessionFilterFails() { ).isInstanceOf( SearchException.class ) .hasMessageContainingAll( "Use a different coordination strategy or an application-level automatic indexing filter.", - "Outbox polling coordination strategy allows only disabling indexing of all types at the session level.", + "The outbox polling coordination strategy allows only disabling the indexing of all types at the session level.", "Applying a session-level automatic indexing filter that does not disable all types is prohibited." ); } ); @@ -87,7 +87,7 @@ public void allTypesMixSessionFilterFails() { ).isInstanceOf( SearchException.class ) .hasMessageContainingAll( "Use a different coordination strategy or an application-level automatic indexing filter.", - "Outbox polling coordination strategy allows only disabling indexing of all types at the session level.", + "The outbox polling coordination strategy allows only disabling the indexing of all types at the session level.", "Applying a session-level automatic indexing filter that does not disable all types is prohibited." ); } ); diff --git a/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/AbstractAutomaticIndexingFilterIT.java b/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/AbstractAutomaticIndexingFilterIT.java index 20dcb52b4e9..1886492f455 100644 --- a/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/AbstractAutomaticIndexingFilterIT.java +++ b/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/AbstractAutomaticIndexingFilterIT.java @@ -14,9 +14,11 @@ import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.ManyToOne; +import javax.persistence.MappedSuperclass; import javax.persistence.OneToMany; import org.hibernate.search.mapper.orm.Search; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.DocumentId; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -58,10 +60,12 @@ public void setup(OrmSetupHelper.SetupContext setupContext) { .expectSchema( EntityA.INDEX, b -> b.field( "indexedField", String.class ) ) .expectSchema( Entity1A.INDEX, b -> b.field( "indexedField", String.class ) ) .expectSchema( Entity2A.INDEX, b -> b.field( "indexedField", String.class ) ) - .expectSchema( Entity1B.INDEX, b -> b.field( "indexedField", String.class ) ); + .expectSchema( Entity1B.INDEX, b -> b.field( "indexedField", String.class ) ) + .expectSchema( EntityFromSuperclass.INDEX, b -> b.field( "indexedField", String.class ) ); setupContext.withAnnotatedTypes( IndexedEntity.class, OtherIndexedEntity.class, ContainedEntity.class, - EntityA.class, Entity1A.class, Entity1B.class, Entity2A.class + EntityA.class, Entity1A.class, Entity1B.class, Entity2A.class, EntityFromSuperclass.class, SuperClass.class, + SimpleNotIndexedEntity.class, NotIndexedEntityFromSuperclass.class ); } @@ -322,4 +326,111 @@ public Entity2A(Integer id, String indexedField) { super( id, indexedField ); } } + + + @MappedSuperclass + public static class SuperClass { + @Id + private Integer id; + + @Basic + @GenericField + private String indexedField; + + public SuperClass() { + } + + public SuperClass(Integer id, String indexedField) { + this.id = id; + this.indexedField = indexedField; + } + } + + public interface InterfaceA { + } + + public interface InterfaceB { + } + + @Entity(name = EntityFromSuperclass.INDEX) + @Indexed + public static class EntityFromSuperclass extends SuperClass implements InterfaceA, InterfaceB { + static final String INDEX = "EntityFromSuperclass"; + + public EntityFromSuperclass() { + } + + public EntityFromSuperclass(Integer id, String indexedField) { + super( id, indexedField ); + } + } + + @Entity(name = NotIndexedEntityFromSuperclass.INDEX) + public static class NotIndexedEntityFromSuperclass extends SuperClass implements InterfaceA, InterfaceB { + static final String INDEX = "NotIndexedEntityFromSuperclass"; + + public NotIndexedEntityFromSuperclass() { + } + + public NotIndexedEntityFromSuperclass(Integer id, String indexedField) { + super( id, indexedField ); + } + } + + @Entity + public static class SimpleNotIndexedEntity { + @Id + private Integer id; + + @Basic + @GenericField + private String indexedField; + + public SimpleNotIndexedEntity() { + } + + public SimpleNotIndexedEntity(Integer id, String indexedField) { + this.id = id; + this.indexedField = indexedField; + } + } + + public static class NotAnEntity { + } + + @Indexed(index = IndexedNotAnEntity.INDEX) + public static class IndexedNotAnEntity { + static final String INDEX = "IndexedNotAnEntity"; + + @DocumentId + private Integer id; + + @GenericField + private String indexedField; + + public IndexedNotAnEntity() { + } + + public IndexedNotAnEntity(Integer id, String indexedField) { + this.id = id; + this.indexedField = indexedField; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getIndexedField() { + return indexedField; + } + + public void setIndexedField(String indexedField) { + this.indexedField = indexedField; + } + } + } diff --git a/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/SessionAutomaticIndexingFilterIT.java b/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/SessionAutomaticIndexingFilterIT.java index 6da02ca671f..716d5d9769c 100644 --- a/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/SessionAutomaticIndexingFilterIT.java +++ b/integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/SessionAutomaticIndexingFilterIT.java @@ -319,4 +319,143 @@ public void applicationFilterExcludeSessionInclude() { } ); backendMock.verifyExpectationsMet(); } + + @Test + public void filterByMappedSuperclass() { + setupHolder.runInTransaction( session -> { + Search.session( session ).automaticIndexingFilter( ctx -> ctx.exclude( SuperClass.class ) ); + + session.persist( new EntityFromSuperclass( 100, "test" ) ); + } ); + backendMock.verifyExpectationsMet(); + } + + @Test + public void filterByNotIndexedEntity() { + setupHolder.runInTransaction( session -> { + assertThatThrownBy( () -> + Search.session( session ).automaticIndexingFilter( + ctx -> ctx.exclude( SimpleNotIndexedEntity.class ) + ) + ).isInstanceOf( SearchException.class ) + .hasMessageContainingAll( + "No matching entity type for class", + SimpleNotIndexedEntity.class.getName(), + "Either this class is not an entity type, or the entity type is not mapped in Hibernate Search" + ); + } ); + } + + @Test + public void filterByRandomClass() { + setupHolder.runInTransaction( session -> { + assertThatThrownBy( () -> + Search.session( session ).automaticIndexingFilter( + ctx -> ctx.exclude( NotAnEntity.class ) + ) + ).isInstanceOf( SearchException.class ) + .hasMessageContainingAll( + "No matching entity type for class", + NotAnEntity.class.getName(), + "Either this class is not an entity type, or the entity type is not mapped in Hibernate Search" + ); + } ); + } + + @Test + public void filterByNotIndexedEntityFormSupertypeWithIndexedSubtype() { + setupHolder.runInTransaction( session -> { + assertThatThrownBy( () -> + Search.session( session ).automaticIndexingFilter( + ctx -> ctx.exclude( NotIndexedEntityFromSuperclass.class ) + ) + ).isInstanceOf( SearchException.class ) + .hasMessageContainingAll( + "No matching entity type for class", + NotIndexedEntityFromSuperclass.class.getName(), + "Either this class is not an entity type, or the entity type is not mapped in Hibernate Search" + ); + } ); + } + + @Test + public void filterByIndexedTypeNotAnEntity() { + setupHolder.runInTransaction( session -> { + assertThatThrownBy( () -> + Search.session( session ).automaticIndexingFilter( + ctx -> ctx.exclude( IndexedNotAnEntity.class ) + ) + ).isInstanceOf( SearchException.class ) + .hasMessageContainingAll( + "No matching entity type for class", + IndexedNotAnEntity.class.getName(), + "Either this class is not an entity type, or the entity type is not mapped in Hibernate Search" + ); + } ); + } + + @Test + public void filterByContainedEntityWontAffectContainingOnes() { + setupHolder.runInTransaction( session -> { + // to prepare data we ignore containing/indexed entity + Search.session( session ).automaticIndexingFilter( + ctx -> ctx.exclude( IndexedEntity.class ) + ); + + IndexedEntity entity1 = new IndexedEntity(); + entity1.setId( 1 ); + entity1.setIndexedField( "initialValue" ); + + ContainedEntity entity2 = new ContainedEntity(); + entity2.setId( 100 ); + entity2.setIndexedField( "initialValue" ); + + entity2.setContainingAsIndexedEmbedded( entity1 ); + entity1.setContainedIndexedEmbedded( Arrays.asList( entity2 ) ); + + session.persist( entity1 ); + session.persist( entity2 ); + + } ); + backendMock.verifyExpectationsMet(); + + setupHolder.runInTransaction( session -> { + // now disable contained entity to not produce updates on containing: + Search.session( session ).automaticIndexingFilter( + ctx -> ctx.exclude( ContainedEntity.class ) + ); + ContainedEntity entity1 = session.get( ContainedEntity.class, 100 ); + entity1.setIndexedField( "updatedValue" ); + } ); + + setupHolder.runInTransaction( session -> { + Search.session( session ).automaticIndexingFilter( + ctx -> ctx.exclude( IndexedEntity.class ) + ); + IndexedEntity entity1 = session.get( IndexedEntity.class, 1 ); + + entity1.getContainedIndexedEmbedded().forEach( e -> e.setContainingAsIndexedEmbedded( null ) ); + + session.remove( entity1 ); + + } ); + backendMock.verifyExpectationsMet(); + } + + @Test + public void filterByInterfaceMustFail() { + setupHolder.runInTransaction( session -> { + assertThatThrownBy( () -> + Search.session( session ).automaticIndexingFilter( + ctx -> ctx.exclude( InterfaceA.class ) + ) + ).isInstanceOf( SearchException.class ) + .hasMessageContainingAll( + "No matching entity type for class", + InterfaceA.class.getName(), + "Either this class is not an entity type, or the entity type is not mapped in Hibernate Search.", + "Valid classes for mapped entity types are: " + ); + } ); + } } diff --git a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/automaticindexing/filter/impl/HibernateOrmAutomaticIndexingTypeFilterContext.java b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/automaticindexing/filter/impl/HibernateOrmAutomaticIndexingTypeFilterContext.java index b4807dee04e..1ceb254a235 100644 --- a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/automaticindexing/filter/impl/HibernateOrmAutomaticIndexingTypeFilterContext.java +++ b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/automaticindexing/filter/impl/HibernateOrmAutomaticIndexingTypeFilterContext.java @@ -13,7 +13,7 @@ import java.util.Set; import org.hibernate.search.mapper.orm.logging.impl.Log; -import org.hibernate.search.mapper.orm.session.impl.HibernateOrmSessionTypeContextProvider; +import org.hibernate.search.mapper.orm.session.impl.HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider; import org.hibernate.search.mapper.pojo.automaticindexing.filter.PojoAutomaticIndexingTypeFilterContext; import org.hibernate.search.mapper.pojo.automaticindexing.filter.spi.PojoAutomaticIndexingTypeFilterHolder; import org.hibernate.search.mapper.pojo.model.spi.PojoRawTypeIdentifier; @@ -24,12 +24,13 @@ public class HibernateOrmAutomaticIndexingTypeFilterContext implements PojoAutom private static final Log log = LoggerFactory.make( Log.class, MethodHandles.lookup() ); - private final HibernateOrmSessionTypeContextProvider contextProvider; + private final HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider contextProvider; private final Set> includes = new HashSet<>(); private final Set> excludes = new HashSet<>(); - public HibernateOrmAutomaticIndexingTypeFilterContext(HibernateOrmSessionTypeContextProvider typeManager) { + public HibernateOrmAutomaticIndexingTypeFilterContext( + HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider typeManager) { this.contextProvider = typeManager; } @@ -46,7 +47,7 @@ public PojoAutomaticIndexingTypeFilterContext include(String name) { @Override public PojoAutomaticIndexingTypeFilterContext include(Class clazz) { addIfNotPresentInOther( - contextProvider.typeIdentifierResolver().resolveByJavaClass( clazz ), + contextProvider.indexedWithSuperTypesByExactClass().getOrFail( clazz ), includes, excludes ); @@ -66,7 +67,7 @@ public PojoAutomaticIndexingTypeFilterContext exclude(String name) { @Override public PojoAutomaticIndexingTypeFilterContext exclude(Class clazz) { addIfNotPresentInOther( - contextProvider.typeIdentifierResolver().resolveByJavaClass( clazz ), + contextProvider.indexedWithSuperTypesByExactClass().getOrFail( clazz ), excludes, includes ); diff --git a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmTypeContextContainer.java b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmTypeContextContainer.java index 286681d0d7d..0c3962117bf 100644 --- a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmTypeContextContainer.java +++ b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmTypeContextContainer.java @@ -44,6 +44,7 @@ class HibernateOrmTypeContextContainer private final KeyValueProvider> byHibernateOrmEntityName; private final KeyValueProvider> byJpaEntityName; private final KeyValueProvider> indexedByJpaEntityName; + private final KeyValueProvider, PojoRawTypeIdentifier> indexedWithSuperTypesByExactClass; private HibernateOrmTypeContextContainer(Builder builder, SessionFactoryImplementor sessionFactory) { this.typeIdentifierResolver = builder.basicTypeMetadataProvider.getTypeIdentifierResolver(); @@ -57,6 +58,7 @@ private HibernateOrmTypeContextContainer(Builder builder, SessionFactoryImplemen Map> byJpaEntityNameContent = new LinkedHashMap<>(); Map> indexedByJpaEntityNameContent = new LinkedHashMap<>(); Map> byHibernateOrmEntityNameContent = new LinkedHashMap<>(); + Map, PojoRawTypeIdentifier> indexedWithSuperTypesByExactClassContent = new LinkedHashMap<>(); for ( HibernateOrmIndexedTypeContext.Builder contextBuilder : builder.indexedTypeContextBuilders ) { HibernateOrmIndexedTypeContext typeContext = contextBuilder.build( sessionFactory ); PojoRawTypeIdentifier typeIdentifier = typeContext.typeIdentifier(); @@ -80,6 +82,12 @@ private HibernateOrmTypeContextContainer(Builder builder, SessionFactoryImplemen indexedByJpaEntityNameContent.put( typeContext.jpaEntityName(), typeContext ); byHibernateOrmEntityNameContent.put( typeContext.hibernateOrmEntityName(), typeContext ); + + for ( PojoRawTypeIdentifier superType : typeContext.ascendingSuperTypes() ) { + if ( isManagedType( sessionFactory, superType.javaClass() ) ) { + indexedWithSuperTypesByExactClassContent.put( superType.javaClass(), superType ); + } + } } for ( HibernateOrmContainedTypeContext.Builder contextBuilder : builder.containedTypeContextBuilders ) { HibernateOrmContainedTypeContext typeContext = contextBuilder.build( sessionFactory ); @@ -99,6 +107,12 @@ private HibernateOrmTypeContextContainer(Builder builder, SessionFactoryImplemen byJpaEntityNameContent.put( typeContext.jpaEntityName(), typeContext ); byHibernateOrmEntityNameContent.put( typeContext.hibernateOrmEntityName(), typeContext ); + + for ( PojoRawTypeIdentifier superType : typeContext.ascendingSuperTypes() ) { + if ( isManagedType( sessionFactory, superType.javaClass() ) ) { + indexedWithSuperTypesByExactClassContent.put( superType.javaClass(), superType ); + } + } } this.byTypeIdentifier = new KeyValueProvider<>( byTypeIdentifierContent, log::unknownTypeIdentifierForMappedEntityType ); this.indexedByTypeIdentifier = new KeyValueProvider<>( indexedByTypeIdentifierContent, log::unknownTypeIdentifierForIndexedEntityType ); @@ -109,6 +123,17 @@ private HibernateOrmTypeContextContainer(Builder builder, SessionFactoryImplemen this.byJpaEntityName = new KeyValueProvider<>( byJpaEntityNameContent, log::unknownJpaEntityNameForMappedEntityType ); this.indexedByJpaEntityName = new KeyValueProvider<>( indexedByJpaEntityNameContent, log::unknownJpaEntityNameForIndexedEntityType ); this.byHibernateOrmEntityName = new KeyValueProvider<>( byHibernateOrmEntityNameContent, log::unknownHibernateOrmEntityNameForMappedEntityType ); + this.indexedWithSuperTypesByExactClass = new KeyValueProvider<>( indexedWithSuperTypesByExactClassContent, log::unknownClassForMappedEntityType ); + } + + private boolean isManagedType(SessionFactoryImplementor sessionFactory, Class javaClass) { + try { + sessionFactory.getMetamodel().managedType( javaClass ); + } + catch (Exception e) { + return false; + } + return true; } @Override @@ -162,6 +187,10 @@ public KeyValueProvider> byHibernateO return byHibernateOrmEntityName; } + public KeyValueProvider, PojoRawTypeIdentifier> indexedWithSuperTypesByExactClass() { + return indexedWithSuperTypesByExactClass; + } + Collection> allIndexed() { return indexedByTypeIdentifier.values(); } diff --git a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/session/impl/HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider.java b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/session/impl/HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider.java new file mode 100644 index 00000000000..787d5027190 --- /dev/null +++ b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/session/impl/HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider.java @@ -0,0 +1,19 @@ +/* + * Hibernate Search, full-text search for your domain model + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later + * See the lgpl.txt file in the root directory or . + */ +package org.hibernate.search.mapper.orm.session.impl; + +import org.hibernate.search.mapper.pojo.model.spi.PojoRawTypeIdentifier; +import org.hibernate.search.mapper.pojo.model.spi.PojoTypeContext; +import org.hibernate.search.util.common.data.spi.KeyValueProvider; + +public interface HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider { + + KeyValueProvider> byEntityName(); + + KeyValueProvider, PojoRawTypeIdentifier> indexedWithSuperTypesByExactClass(); + +} diff --git a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/session/impl/HibernateOrmSessionTypeContextProvider.java b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/session/impl/HibernateOrmSessionTypeContextProvider.java index 3fae2a2858e..f3b4f5a40eb 100644 --- a/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/session/impl/HibernateOrmSessionTypeContextProvider.java +++ b/mapper/orm/src/main/java/org/hibernate/search/mapper/orm/session/impl/HibernateOrmSessionTypeContextProvider.java @@ -13,7 +13,8 @@ public interface HibernateOrmSessionTypeContextProvider extends HibernateOrmRuntimeIntrospectorTypeContextProvider, - SearchIndexingPlanTypeContextProvider, LoadingIndexedTypeContextProvider { + HibernateOrmAutomaticIndexingTypeFilterTypeContextProvider, + SearchIndexingPlanTypeContextProvider, LoadingIndexedTypeContextProvider { KeyValueProvider> byJpaEntityName(); diff --git a/orm6/mapper/orm/ant-src-changes.patch b/orm6/mapper/orm/ant-src-changes.patch index 43501d305f1..9afbc41b57e 100644 --- a/orm6/mapper/orm/ant-src-changes.patch +++ b/orm6/mapper/orm/ant-src-changes.patch @@ -403,7 +403,20 @@ index 44069a5558..9cd86db6e5 100644 + collector.value( getExtractorPath( value ) ).decimalScale( scale ); } } - + +diff --git a/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmTypeContextContainer.java b/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmTypeContextContainer.java +index 0c3962117b..75ea12397e 100644 +--- a/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmTypeContextContainer.java ++++ b/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmTypeContextContainer.java +@@ -128,7 +128,7 @@ private HibernateOrmTypeContextContainer(Builder builder, SessionFactoryImplemen + + private boolean isManagedType(SessionFactoryImplementor sessionFactory, Class javaClass) { + try { +- sessionFactory.getMetamodel().managedType( javaClass ); ++ sessionFactory.getJpaMetamodel().managedType( javaClass ); + } + catch (Exception e) { + return false; diff --git a/main/java/org/hibernate/search/mapper/orm/model/impl/HibernateOrmBasicTypeMetadataProvider.java b/main/java/org/hibernate/search/mapper/orm/model/impl/HibernateOrmBasicTypeMetadataProvider.java index 77d7b8f982..d03fcba6e2 100644 --- a/main/java/org/hibernate/search/mapper/orm/model/impl/HibernateOrmBasicTypeMetadataProvider.java