Hibernate Search Not giving any errror when @DocumentId not mentioned, but hangs at configuration.buildSessionFactory()

Description

Consider a case in which primary key is associated with only Base class, with no primary key in any other subclasses marked for Lucene's document id.
Now, if this attribute is not annotated with @DocumentId, hibernate engine shows no errors, but it hangs up at configuration.buildSessionFactory(); and doesn't move forward.
The moment the annotation is added, the SessionFactory gets built and the application works.

Example Model :

Aobject.java :
long id; (this is the intended field to be taken as documentID for lucene )

MyObject extends Aobject
(This class is to be indexed.It has no id field of its own, the same id from AObject acts as PK for MyObject Also)

Attachments

1

Activity

Show:

Yoann Rodière September 26, 2023 at 9:37 AM

Hello,

This issue was reported against Hibernate Search 5.x or earlier, and doesn't seem to be relevant to newer Hibernate Search versions (6.x+).

In order to focus on newer versions, we are going to close this issue.

If you are still affected by this issue on Hibernate Search 6.0 or later, and have a reproducer, please comment here or reach out to us so we can reopen the issue.

If you are still affected by this issue on Hibernate Search 5.x, and want to provide a fix, please comment here or reach out to us so we can work out the next steps with you.

Cheers,
Yoann

Kiran Narasareddy September 14, 2010 at 10:16 AM

Hey Sanne, any updates on the issue?

Kiran Narasareddy September 8, 2010 at 7:36 AM

Sanne, just uploaded sample entity. Ask me if you need something else. (Sorry for the delay)

Kiran Narasareddy September 8, 2010 at 7:35 AM

It consists of 2 classes AClazz and User. User extends AClazz. Currently the 'hjid' field (which acts the primary id for both AClass n User ) in the AClazz is annotated to be DocumentId. The current sample entity works fine, but as soon as we remove the 'DocumentId' annotation from AClazz, the app hangs at 'cfg.buildSessionFactory'

Sanne Grinovero September 3, 2010 at 9:47 AM

no worries

Out of Date

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created May 7, 2010 at 4:14 PM
Updated September 26, 2023 at 9:37 AM
Resolved September 26, 2023 at 9:37 AM