Here is the code snippet below and I am getting below exception at startup. Exception message is very clear but not sure where exactly(on which field) we need to put @AssociationInverseSide annotation.
Hibernate ORM mapping:
path '.linkType<no value extractors>':
- HSEARCH700020: Unable to find the inverse side of the association on type 'com.xxx.xxx.model.Link' at path '.type<no value extractors>'. Hibernate Search needs this information in order to reindex 'com.xxx.xxx.model.Link' when 'com.xxx.xxx.model.LinkType' is modified. You can solve this error by defining the inverse side of this association, either with annotations specific to your integration (@OneToMany(mappedBy = ...) in Hibernate ORM) or with the Hibernate Search @AssociationInverseSide annotation.
Come on, it tells you what the problematic association is right there in the error message:
So you need to define the inverse side of Link#type. Most likely a new @OneToMany(mappedBy = "type") List<Link> links association in whatever entity your type association points to (Type? LinkType?).
If defining this inverse side is not an option, you can always explicitly opt out of automatic reindexing for that association: Hibernate Search 6.1.1.Final: Reference Documentation . You’ll basically get the Hibernate Search 5 behavior for indexed transient attributes, then.
If I add this code then exception is going away but few existing test case are failing. However will work on try to fix it but just wanted to check is there any alternate option to resolve inverside exception without this code or @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.NO)?
I think test are failing because of cyclic call. Handler dispatch failed; nested exception is java.lang.StackOverflowError