我有以下型号
@Entity
@Table(name = "GRAPH")
public class Graph {
[...]
@ElementCollection
@CollectionTable(name = "ROOT", joinColumns = @JoinColumn(name = "GRAPH", nullable = false))
private Set<Root> roots;
}
@Entity
@Table(name = "NODE")
public class Node {
[...]
}
@Embeddable
public class Root {
[...]
@ManyToOne(optional = false)
@JoinColumn(name = "NODE", nullable = false)
private Node node;
}
我使用EclipseLink作为JPA Provider。让EclipseLink为此结构生成DDL时,会发生以下情况:
你能帮我解释一下这种行为的原因吗?是否可以对主键和缺少的外键进行操作?
谢谢, 微米。