0 Replies Latest reply on Jun 9, 2016 5:13 AM by Lucas Persson

    Nullable FK gets created as not null FK in the _AUD table?

    Lucas Persson Newbie



      I have an entity with two optional @ManyToOne relations. In the Db the table has show two columns set to "not null=false", that is, they can be null.

      In the corresponding Envers table show two columns tighter with the REV column is used as a compound primary key.

      But since the columns in the original table can be null I get an exception when the _AUD table is updated (since the parts in the PK can't be null)


      Why did even Envers opt to use the FK from the original table in the PK in the _AUD table and not ut "id" columns (which is the PK in the original table)?