1 Reply Latest reply on Jan 6, 2009 10:10 AM by adamw

    envers and compound primary keys

    omeske

      We have a database design that needs to use partitioning, and for this we need to add the partitioning key to ALL primary keys of all tables. Thats why we have almost all primary keys as compound keys with two fields (the partitioning key and the entity id).

      I try to use the envers project with this compound primary keys for ALL tables (including the @RevisionEntity) and envers fails with an

      org.hibernate.MappingException: Foreign key (FK7535344A74C7597:IssueCustomMetaData_AUD [REV])) must have same number of columns as the referenced primary key (RevisionEntry [id,publicationID])

      during startup.

      My @RevisionEntity class has an @Embeddable class with two fields that is used as @Id (like almost all other entities of my application). So all foreign keys have to use at least three or four columns.

      So is there a plan or roadmap to support compound primary keys or does anyone has an idea how much work is needed to support this feature?


        • 1. Re: envers and compound primary keys
          adamw

          Hello,

          compound primary keys are supported in entities, but I haven't tested it with revision entities, so it's possible there's something missing there.

          If you can, please create a failing test (there's a lot of tests in envers trunk on which you can base) and attach it to a JIRA issue.

          --
          Thanks,
          Adam