Mutlitenant RevisionEntity / Envers Metadata Customisation

Hi

I’ve setup a multi tenant revisions using id and tenant id as PK for the revisions table. When setting up the RevisionEntity, envers / hibernate will fail with

Caused by: org.hibernate.MappingException: Foreign key (FK8vb2v4n8wkduum583ee3hvfix:my_entity_aud [rev])) must have same number of columns as the referenced primary key (revisions [rev,tenant_id])
	at app//org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:138)
	at app//org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:119)

So it seems that envers does revision entity does not support multiple IDs.

Is there a way to change the envers entity metadata prior to hibernate initialising it, so that the additional fkey columns can be added?

Please try to create a reproducer with our test case template (hibernate-test-case-templates/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java at main · hibernate/hibernate-test-case-templates · GitHub) and if you are able to reproduce the issue, create a bug ticket in our issue tracker(https://hibernate.atlassian.net) and attach that reproducer.