Open Riva-Tholoor-Philip opened 1 month ago
Java Record was implemented by https://github.com/eclipse-ee4j/eclipselink/pull/2163 It's not available in 5.0.0-B02.v202404111748, please try latest Maven snapshot like https://jakarta.oss.sonatype.org/content/groups/staging/org/eclipse/persistence/eclipselink/5.0.0-SNAPSHOT/eclipselink-5.0.0-20240718.131610-56.jar
@Riva-Tholoor-Philip can you check current state, please?
Sure @lukasj
The following error occurred when we tried to define an entity with an embeddable that is a Java record, which is supposed to be allowed in Jakarta Persistence 3.2:
Entity:
Embeddable/record:
It is complaining that the record needs a default constructor. Even if I add one, which should not be necessary,
then it fails a little later on with a different error about being unable to set values on the embeddable. It seems like EclipseLink doesn't realize it needs to treat the Java record embeddable differently than a normal embeddable.
Also, if I try working around this by not using Java records, and switching to a Java class for the embeddable, it still get's an unexpected failure where it seems that EclipseLink has failed to disambiguate the embeddable attributes in the database when the entity has two attributes of the same embeddable type: