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:
@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?
Hibernate 5.1.0.Final, Wildfly 10, mariaDB (mysqldriver 1.3.7)