Uploaded image for project: 'Hibernate ORM'
  1. HHH-10841

Field marked as @Generated not being audited.

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      I have a table, which has an auto_increment field (this is not the PK, it is just another field), which I defined this way:

      @NotNull
      @Generated(GenerationTime.INSERT)
      @Column(columnDefinition = "integer auto_increment")
      private int caseNumber;

      I also created an index and a unique constraint for this field as mysql requires.

      Somehow Envers is not recognizing this field and doesn't store the value of caseNumber in the audition table. The insert sentence that is being logged saves all fields of my entity but this one.

      Does anyone know why this is happening? Is something wrong in the definition of the field? Is Envers not getting along with auto_increment?

      I guess that as the caseNumber is not "inserted" but autogenerated, Envers doesn't notice that this field has a value. If this is the case it is actually a bug because is an actual value that should be tracked. Is there any workaround?

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: