GWT Requestfactory 3 nested object

65 Views Asked by At

I have a GWT application with Requestfactory. On the serverside I have a service returning a triple nested object. A contains a List<B> #B. Each B contains a C. When I fire my request to findAll(A).with("B","C").fire(receiver) it only returns B values. C is null. In debugging I see that up to the DAO the A object is properly set with all values. (Clientside all extend EntityProxy)

Right now I need to fire seperate requests to get C for every B selected in the list of A. Which means more back and forth...

Thanks

1

There are 1 best solutions below

3
Colin Alworth On

If A contains B, you need .with("B"). If A contains C, you would add "C" to that call, but since B contains C, you instead add "B.C":

findAll(A).with("B","B.C").fire(receiver)

Real world example: Person (A) has Address (C), and Person has Employer (B), and Employer also has Address (C). You were asking RequestFactory to send Person, their Employer and the Person's address, but not the Employer's Address.