JPAContainer filter Join with a ManyToMany relationship

Hi everyone!

I have a ManyToMany relationship between User and Context class with an extra-column in the intermediate table.

Users.java

@Entity @Table(name = "USERS") public class Users { private Long user_id; private Long niu; private String nom; private String mail; private Set<UserContext> userContexts = new HashSet<UserContext>(0); Context.java

@Entity
@Table(name = "CONTEXT")
public class Context {

private Long id;
private String name;
private Area area;
private String code;
private Set<UserContext> userContexts = new HashSet<UserContext>(0);

UserContext.java

[code]
@Entity
@Table(name = “SAT20_USER_CTX”)
@AssociationOverrides({
@AssociationOverride(name = “pk.user”,
joinColumns = @JoinColumn(name = “USER_ID”)),
@AssociationOverride(name = “pk.context”,
joinColumns = @JoinColumn(name = “CTXT_ID”)) })
public class UserContext implements Serializable{

private static final long serialVersionUID = 1L;
private UserContextID pk = new UserContextID();
private String admin;
[/code]UserContextID.java[code]
@Embeddable
public class UserContextID implements Serializable {

private static final long serialVersionUID = -9120607274421816301L;
private Users user;
private Context context;
[/code]I have a table that is filled using a JPAContainer,

private JPAContainer<Users> persons = JPAContainerFactory.make(Users.class, PERSISTENCE_UNIT); actually it shows all the User (without filter by Context), that I want is filter by a concrete context id using this MayToMany relationship, any idea? I have tried to use JoinFilters and overriding persons.getEntityProvider().setQueryModifierDelegate(new DefaultQueryModifierDelegate() but I couldn’t get it, help me please!

Thanks in advance!