[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]

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.