Hibernate Search incorrectly adds synthetic Hibernate ORM properties to the metamodel, ultimately leading to a bootstrap failure

Description

Apparently if a ManyToOne association uses a column that is not the ID as a join column, Hibernate ORM creates a SyntheticProperty.

Hibernate Search does not currently detect those as edge cases; it tries to add them to the metadata in org.hibernate.search.mapper.orm.mapping.impl.HibernateOrmMetatadaContributor#collectPropertyMetadataContributors and ultimately crashes because those properties are not real and cannot be resolved to a getter.

We probably should ignore synthetic properties.

And while we’re at it, let’s ignore {{Backref}} and {{IndexBackref}} too

 

See https://discourse.hibernate.org/t/hs-6-and-referencedcolumnname/5053/3
See https://github.com/Zasch/hsearch/commit/00769563e75c0de9643432b5e167eeaff3c1f726

Environment

None
Fixed

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Major