Dormmamu
Dormmamu

Reputation: 11

GWT Requestfactory 3 nested object

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

Upvotes: 0

Views: 68

Answers (1)

Colin Alworth
Colin Alworth

Reputation: 18356

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.

Upvotes: 1

Related Questions