We have a requirement to persist into separate tables history records for our entities. I looked into Envers but the REVINFO table is a problem for retrofitting existing customers and performance.
I was thinking of an approach where we have each or our "concrete" entites (say CUSTOMER) annotated with @MappedSuperclass ....data would be saved to the CUSTOMER table. We would entity subclass Customer class called "CustomerHistory" and add the fields we need (historyId (primary key), start time, end time) that would be persisted to the CUSTOMER_ADDRESS table.
Would this work? With JPA handle the primary key in 2 tables?
Thanks.