I use records as Embeddables in my entities. All worked well till I introduced envers. Now, when trying to load a revision, I always get a error, that hibernate is missing a no-args constructor. n
I reproduced this error with the hibernate envers tutorial example code from Getting Started with Hibernate. I just added a property
@Embedded
private TheRecord theRecord;
with
@Embeddable
public record TheRecord(String name) {
}
to the entity. Saving and reading the entity works quite well, but calling
Event firstRevision = reader.find( Event.class, 2L, 1 );
leads to
org.hibernate.envers.exception.AuditException: org.hibernate.PropertyNotFoundException: Object class [org.hibernate.tutorial.envers.TheRecord] must declare a default (no-argument) constructor
Is this a known issue? Are there plans to support records with envers? Does anyone knows a workaround not turning all my records into POJOs.