Unable to enhance persistent attribute with declared targetEntity

Description

When trying to enhance class annotated with @ManyToOne with targetEntity=Country.class at build-time, hibernate-enhance-maven-plugin logs an error

[ERROR] Failed to execute goal org.hibernate.orm.tooling:hibernate-enhance-maven
-plugin:5.0.1.Final:enhance (default) on project test-enhance-maven-plugin: Unab
le to enhance class: entity.Address: Unable to enhance persistent attribute [ent
ity.Address:country]: UndeclaredThrowableException: entity.Country -> [Help 1]

See the attached test project (test-enhance-maven-plugin) to reproduce this issue.

Environment

None

Status

Assignee

Luis Barreiro

Reporter

LAdO

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.1

Priority

Major
Configure