Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-3529

MassIndexer fails for entities with primitive ID type

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0.Alpha2
    • Fix Version/s: 6.0.0.Alpha3
    • Component/s: mapper-orm
    • Labels:
      None

      Description

      Caused by: java.lang.IllegalArgumentException: Attribute [io.quarkus.test.hibernate.search.elasticsearch.search.Person#id : long] not castable to requested type [java.lang.Object]
          at org.hibernate.metamodel.model.domain.internal.AbstractIdentifiableType.checkType(AbstractIdentifiableType.java:129)
          at org.hibernate.metamodel.model.domain.internal.AbstractIdentifiableType.getId(AbstractIdentifiableType.java:93)
          at org.hibernate.search.mapper.orm.massindexing.impl.BatchIndexingWorkspace.<init>(BatchIndexingWorkspace.java:74)
          at org.hibernate.search.mapper.orm.massindexing.impl.BatchCoordinator.doBatchWork(BatchCoordinator.java:124)
          at org.hibernate.search.mapper.orm.massindexing.impl.BatchCoordinator.runWithErrorHandler(BatchCoordinator.java:92)
          at org.hibernate.search.mapper.orm.massindexing.impl.ErrorHandledRunnable.run(ErrorHandledRunnable.java:29)
      

      It seems this call:

      		this.idNameOfIndexedType = sessionFactory.getMetamodel().entity( indexedType ).getId( Object.class ).getName();
      

      should be replaced with this:

      		this.idNameOfIndexedType = sessionFactory.getMetamodel().entity( indexedType ).locateIdAttribute().getName();
      

        Attachments

          Activity

            People

            • Assignee:
              yrodiere Yoann Rodière
              Reporter:
              yrodiere Yoann Rodière
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: