「1」を親として双方向の1対多の関係を設定しようとしています
私には親がいます:
@Entity
public class VideoOnDemand {
@OneToMany(cascade = CascadeType.ALL)
@LazyCollection(LazyCollectionOption.FALSE)
@JoinColumn(name = "video_id")
private List<CuePoint> cuePoints = new ArrayList<CuePoint>();
}
と子供:
@Entity
public class CuePoint {
@ManyToOne(cascade=CascadeType.ALL)
@JoinColumn(name = "video_id", insertable = false, updatable = false)
private VideoOnDemand video;
}
Hibernate の公式ドキュメント(2.2.5.3.1.1) の推奨事項を使用しました。ただし、Hibernate は CuePoint が子エンティティであることを認識していないようです。そのため、CuePoint を削除すると、VideoOnDemand も他のすべての CuePoints と共に削除されます。
私は何を間違っており、正しい方法は何ですか?