Using Programmatic API, the document ID is not inherited

Description

If the document id is not defined in the child class (which is persisted) but in the parent class, the following exception occurs:

org.hibernate.HibernateException: could not init listeners
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)
...
Caused by: org.hibernate.search.SearchException: No document id in: org.mycompany.hibernate.search.MySubClass
...

I attached a simple example. It is a maven project which the test fails until the document id in the MySubClass class is not uncommented.

Environment

Hibernate 3.5.1, hsqldb 1.8.0.7

Activity

Show:
Damien Raude-Morvan
March 1, 2012, 5:30 PM

Hi,

I can confirm this issue is still present with

  • Hibernate Core 3.5.6-Final

  • Hibernate Search 3.2.0.Final

Is there a known workaround (other than duplicating docid into parent class) ?

Regards,

Yoann Rodière
May 27, 2020, 8:10 AM

Was fixed some time ago in Hibernate Search 6.

Assignee

Yoann Rodière

Reporter

Chaffotte

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Minor
Configure