Hmm, well the audit table's key should be copied from the entity's key. Are the properties in any way part of the primary key of the entity?
Thanks for your prompt response. The properties shouldn't be included in the primary key for the entity. I checked this by forcing recreation of the main data table (for the same data type I used previously as an example) and here's the logging output:
create table TICKET (ID integer not null, FIELD1 varchar(255), FIELD2 varchar(255), FIELD3 varchar(255), FIELD4 longtext, FIELD5 integer, FIELD6 varchar(255), ..., primary key (ID)) ENGINE=InnoDB
I thought that the audit table utilized the primary key from the table being audited and tacked on REV so I was also surprised to see another column get pulled in for properties. For the record, here's a snippet from our hbm.xml for mapping properties:
<map name='properties' table='TICKET_PROPERTIES' cascade='all'>
<map-key column='PROPERTY_KEY' type='java.lang.String'/>
<element column='PROPERTY_VALUE' type='java.lang.String'/>
For the record we are using Hibernate and Envers 4.1.6. Any input is appreciated, thanks!
Can you maybe post a full (but minimal ) example of an entity with its primary key, which causes problems?
I have no idea why this could be happening.