Skip to content

Tag: embeddable

Using Java records as JPA embeddables

I want to use Java records as embeddable objects with JPA. For example I want to wrap the ID in a record to make it typesafe: But If I try to persist it with Hibernate 5.4.32 I get the following error: So it looks like Hibernate would treat the record Id like an entity, although it is an @Embeddable. The