读书人

[Hibernate] How to have 二 collecti

发布时间: 2012-10-20 14:12:48 作者: rapoo

[Hibernate] How to have 2 collections of the same type in JPA/Hibernate?
这种情况这么办?

    public class Parent{       private List<String> sons;   //我希望把这个关系映射到  parent_child 表       private List<String> daughters; //我希望把这个关系也映射到 parent_child 表   }


答案是: You can't do it.

看这个URL:
[url] http://stackoverflow.com/questions/669828/how-to-have-2-collections-of-the-same-type-in-jpa[/url]

读书人网 >软件架构设计

热点推荐