我有以下@Entity
类
@Entity
public class Asset {
@Id
private long id;
@Enumerated(EnumType.STRING)
private TagType tagType;
private String tagId;
@OneToOne(cascade = CascadeType.ALL, optional = true, orphanRemoval = true)
@JoinColumns(value = {
@JoinColumn(name = "tagId", referencedColumnName = "tagId", nullable = true, insertable = false, updatable = false),
@JoinColumn(name = "tagType", referencedColumnName = "tagType", nullable = true, insertable = false, updatable = false)})
private TagInfo tagInfo;
...
}
和
@Entity
public class TagInfo {
@Id
private String tagId
@Id
private TagType tagType
...
}
当EclipseLink开始使用"eclipselink.ddl-generation" = "drop-and-create-tables"
时,它会创建具有以下约束的ASSET
表:
CONSTRAINT FK_ASSET_TAGTYPE FOREIGN KEY(TAGTYPE,TAGID) REFERENCES TAGINFO(TAGTYPE,TAGID))
有没有让EclipseLink NOT 在Asset
表上创建上述约束?