Support indexing of entities using an @IdClass for composite keys

Description

Apparently we have no mapping solution for composite key cases as described at:
https://forum.hibernate.org/viewtopic.php?f=9&t=1024512

I think that's a major use case and we should definitely provide a solution.
I'm pretty sure that I did such mappings in the past and don't remember what kind of workaround I might have used - that was a long time ago and it might not be possible anymore - or if it is, we should document the strategy.

Environment

None

Activity

Show:
Giovanni Lovato
March 16, 2016, 11:31 AM

Any feedback/workaround for this issue? I'm hitting it and I can't switch to EmbeddedId, and @DocumentId on a getter throws:

Sanne Grinovero
March 16, 2016, 10:30 PM

Hi Giovanni,
the general problem is that the indexing system requires a single term to unequivocally identify the entity.

So if in the database your composite id is made of two strings (for example), you need to be able to provide a bridge which transforms the pair into a keyword; Unfortunately not knowing what you might store in strings it is not safe for Hibernate Search to do this mapping automatically.

The @DocumentId strategy should work, could you describe your error, or even better provide a full example?

Assignee

Unassigned

Reporter

Sanne Grinovero

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure