我已经Entity
包含一个@Embeddable @ElementCollection
. 当试图坚持这一点时,我不断得到一个NonUniqueObjectException
.
@Entity
@Audited
public class Entity(){
private Long entityId;
@ElementCollection
private Set<MyEmbeddableCollection> collections = new HashSet<MyEmbeddableCollection>();
}
@Embeddable
public class myEmbeddableCollection(){
private String myId;
查看日志,我可以看到 Envers 不包括myId
envers 表。仅包含对实体的引用。
[HIST_Entity_collections#{revision_id=DefaultRevisionEntity(id = 3, revisionDate = 2013-sep-04 08:44:56), revisionTyp=ADD, entityId=1}]
我正在使用 hibernate-envers 4.2.0.Final-redhat-1。有人对为什么会发生这种情况有任何解决方案或解释吗?