When defining an entity as follows:
{code :java } @Entity @Audited public class MyEntity { @Id private Integer id; private boolean active; private char charData; private long longData; private byte byteData; private int intData; private short shortData; private float floatData; private double doubleData; // getters, setters } {code} When ORM defines the DDL for creating the table, the {{active}} column and other primitive data types will be defined as {{not null}} since the property uses the primitive boolean type rather than the Object equivalent which can support nulls. However, when the audit DDL is generated for the corresponding column columns in the audit table, Envers generates the DDL differently, actually allowing the {{active}} column primitive type columns to be nullable when it should be identical to that of ORM. |
|