| My envers configuration is:
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");
Now, I have the following entity:
@Audited
@Entity(name = "orders")
public final class Order {
@ManyToOne
@JoinColumn(name = "customer_account_id", nullable = false)
private CustomerAccount customerAccount;
}
Now, running hibernate creates the following tables:
- 1. A table `orders` is created with the column (among others)
- 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. I think, envers is ignoring the custom column name for the '_mod' fields defined by '@JoinColumn(name = "customer_account_id" ...). |