How to Construct Syntax for this rule

1 message Options
Embed this post
Permalink
ken.p

How to Construct Syntax for this rule

Reply Threaded More More options
Print post
Permalink
Hi,

I have  object A is parent of object B
public class A{
   private List bObjects;
}

public class B{
   private String name;
}


and I need to collect all object A where A has 1 B which satisfy a particular condition. I try the below but it does not work

i: ArrayList() from collect (a:A(bObjects contains B(name="123")))

What should be the way to approach this kind of rule?