@Entity
@Table
@Audited
public class Research
{
.....
@ElementCollection(targetClass = Reason.class)
@Column(nullable = false)
@Enumerated(EnumType.STRING)
@CollectionTable(name = "reason")
private List<Reason> reasons = new ArrayList<>();
.....
}
public enum Reason
{
REASON_1,
REASON_2,
REASON_3
}
<hibernate-configuration> <session-factory> .... <property name="org.hibernate.envers.revision_on_collection_change">false</property> .... </session-factory> </hibernate-configuration> We expect that only audit record(s) wil be added in table reason_aud when something changed in 'reasons' list. That now works with your fix. But unfortunately there also wil be added an audit record in table research_aud despite revision_on_collection_change = false. Note: We have adapted your fix/patch to a lightly older version than your fix wil be released. Namely 5.217. Could that be explain this behavior? |