[jboss-user] [EJB 3.0] - EJB-QL join with UNIDIRECTIONAL relationship

micho do-not-reply at jboss.com
Mon Feb 26 16:03:25 EST 2007


I have a UNIDIRECTIONAL ManyToMany Relationship between useres and usergroups. Users know their usergroups, usergroups don´t know their users.

I want to create a query to get all Usergroups which are referenced by a User with name 'john'

I tried:
select ug from UserGroup as ug, User as u join u.userGroupList where u.name = 'john' 
  | but got an empty result, what´s wrong?

@Entity
  | public class User implements Serializable
  | { ...
  |   public String getName()
  |   @ManyToMany 
  |   public List<UserGroup> getUserGroupList()
  |   
  | @Entity
  | public class UserGroup implements Serializable
  | {	..
  | }

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

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




More information about the jboss-user mailing list