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

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Sprint

Priority

Created February 12, 2021 at 3:16 PM
Updated February 23, 2021 at 2:00 PM
Resolved February 23, 2021 at 11:45 AM