2 Replies Latest reply on Aug 28, 2009 3:23 PM by Brendan Farragher

    One to many relation issues

    Jeremy Gibson Newbie

      Hi,

      I'm trying to have a person entity who has a collection of person entities representing his children. I have it marked as follows:

       private Collection<Person> children;
       ...
       @OneToMany
       public Collection<Person> getChildren() {
       return children;
       }
      


      But when I deploy this it gives me the following error.

      org.hibernate.MappingException: Could not determine type for: java.util.Collection, for columns: [org.hibernate.mapping.Column(children)]

      I haven't found other examples of entity having instances of themselves but did see a post where someone was having a similar issue relating to having a collection of enitites from a "close relative" on the inheritance tree, so I am not sure whether this is a common issue. Any help is appreciated

      Jeremy