Using @Embedded with Kotlin results in PropertyNotFoundException exception

Description

The follow file and repo show a case where the @Embedded annotation cannot be used in a Kotlin context:;

https://github.com/languitar/quarkus-jpa-bug-example/blob/master/src/main/kotlin/org/acme/Entities.kt

Stipped down

This code results in the following exception:

I first thought this was the result of using hibernate in Quarks. Therefore, yesterday I filed the following bug there: https://github.com/quarkusio/quarkus/issues/13678. However, today I also reproduced this in spring boot.

The Github repository linked above is a straight replication of the bug, which can be triggered by calling ./mvnw clean compile quarkus:dev.

Environment

None

Activity

Show:
Johannes Wienke
December 4, 2020, 5:09 PM

Is this what you mean:

That doesn’t change the exception.

In any case, if what I am doing should actually be prohibited, maybe the bug is then that the Java implementation doesn’t prevent this?

Jan-Willem Gmelig Meyling
December 4, 2020, 5:12 PM

If it works in Java then it should work in Kotlin as well, Ive used JPA with both of them a lot... if its apparently not the id causing the issue, it must be something with the generated bytecode. Perhaps move the field from the constructor to the class body?

Johannes Wienke
December 4, 2020, 5:16 PM

I had also tried that. I think I have tried every combination that I could think of without success.

Jan-Willem Gmelig Meyling
December 4, 2020, 5:17 PM

Are you using the Kotlin JPA compiler plugin? This opens up the Kotlin classes. https://kotlinlang.org/docs/reference/compiler-plugins.html

Johannes Wienke
December 4, 2020, 5:24 PM

yes, thats contained in the test repo as well

Assignee

Unassigned

Reporter

Johannes Wienke

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure