Hi, I need to query the join table of a many to many relationship and am having 
trouble.

PersistentValue class:

        @ManyToMany(cascade = {CascadeType.ALL}, fetch = FetchType.LAZY)
  |     @JoinTable(name = "user_filter",
  |                     [EMAIL PROTECTED](name="persistentvalue_id")},
  |                     [EMAIL PROTECTED](name="persistentuser_id")})
  |     public Collection<PersistentUser> getUsersAllowed() {
  |             if(usersAllowed == null) usersAllowed = new 
ArrayList<PersistentUser>();
  |             return usersAllowed;
  |     }


PersistentUser class:

        @ManyToMany(mappedBy = "usersAllowed")
  |     public Collection<PersistentValue> getUserFilters() {
  |             if(userFilters == null) userFilters = new 
ArrayList<PersistentValue>();
  |             return userFilters;
  |     }


If I try to query user_filters directly, I get a 'no such mapping exception'. 
Do I need to create an entity representing the join table, and if so, how do i 
do this?

Your help appreciated, thanks.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963139
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to