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",
joinColumns={@JoinColumn(name="persistentvalue_id")},
inverseJoinColumns={@JoinColumn(name="persistentuser_id")})
public Collection<PersistentUser> getUsersAllowed() {
if(usersAllowed == null) usersAllowed = new ArrayList<PersistentUser>();
return usersAllowed;
}@ManyToMany(mappedBy = "usersAllowed")
public Collection<PersistentValue> getUserFilters() {
if(userFilters == null) userFilters = new ArrayList<PersistentValue>();
return userFilters;
}