FilterMany for Play 2 returns all results

I am using Play 2.0.2 with ebean.

In the Info class, I defined

 @ManyToMany(fetch=FetchType.EAGER) private Set<MemberInfo> members; private Date createdDate = new Date(); 

And MemberInfo has a memberId field.

When i do

 public static Finder<Long,Info> find = new Finder<Long,Info>(Long.class, Info.class); find.fetch("members") .where().filterMany("members").eq("memberId", memberId) .order().desc("createdDate") .findList(); 

It returns all Info without checking memberId for members .

What did I do wrong? Thanks.

+6
source share
1 answer

filterMany() does not filter parental results by expression of children (both have separate "ranges").

As described in his API , it will find all Info objects and filtered members for each.

There is also a very similar topic in Google Groups where the question author gives his own workaround for this.

Learn the difference between:

 find.fetch("members") .where().filterMany("members").eq("memberId", 1L) .findList(); 

and

 find.fetch("members") .where().eq("members.memberId", 1L) .findList(); 
+8
source share

All Articles