开发者

hibernate field of type map requires nullable = true

Using hibernate 3.6.3.Final I have this Mapping in an entity.

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 
@JoinColumn(name = "policy_id", referencedColumnName = "id", nullable = false)
@MapKeyColumn(name = "document_type", nullable = true) 
@MapKeyEnumerated(EnumType.STRING)
private final Map<DocumentType, PolicyDocument> poli开发者_如何学编程cyDocuments = new HashMap<DocumentType, PolicyDocument>();

But I want to know why I have to have the MapKeyColoum as nullable = true.

I don't want insert then update type queries.

If I change it to nullable false I get no default value for document type.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜