2

Entityを含むenがあり@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 がmyIdenvers テーブルに含まれていないことがわかります。エンティティへの参照のみが含まれます。

[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 を使用しています。なぜこれが起こっているのか、誰かが解決策や説明を持っていますか?

4

1 に答える 1