[jboss-user] [EJB 3.0] - Re: mapping example onetoMany

Wolfgang Knauf do-not-reply at jboss.com
Tue Jan 16 07:30:05 EST 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002245#4002245

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002245



More information about the jboss-user mailing list