My envers configuration is:
{code:java} properties.setProperty(EnversSettings.AUDIT_TABLE_SUFFIX, "_history"); properties.setProperty(EnversSettings.AUDIT_STRATEGY, "org.hibernate.envers.strategy.ValidityAuditStrategy"); properties.setProperty(EnversSettings.GLOBAL_WITH_MODIFIED_FLAG, "true"); properties.setProperty(EnversSettings.MODIFIED_FLAG_SUFFIX, "_mod"); {code}
Now, I have the following entity:
{code:java} @Audited @Entity(name = "orders") public final class Order { @ManyToOne @JoinColumn(name = "customer_account_id", nullable = false) private CustomerAccount customerAccount;
// And many more ... (including an id, ...) }
{code}
Now, running hibernate creates the following tables:
1. A table `orders` is created with the column (among others) * 'customer_account_id'
2. A table `orders_history` is created with the following columns (among others) * `customer_account_id` * `customer_account_mod`.
But, I think, the name of second column , storing the modification flag , should be `customer_account_id_mod` instead.
So, I think, envers is ignoring the custom column name for the '_mod' fields defined by '@JoinColumn(name = "customer_account_id" ...). |
|