This content has been marked as final.
Show 1 reply
-
1. Re: mapping example onetoMany
wolfgangknauf Jan 16, 2007 7:30 AM (in response to trashhash)Hi !
I think you have to use a generic list so that the container can determine which type is contained in the list:public class Team (...) @OneToMany(mappedBy="team") private List<User> teamList;
The snippet of class "User" seems to be wrong, you probably meant this:public class User (...) @ManyToOne @JoinColumn(name="team_id",referencedColumnName="id") protected Team team;
Hope this helps
Wolfgang