requestFactory, how to get entity proxy transitively

20 views
Skip to first unread message

Mike Guo

unread,
Dec 28, 2010, 6:00:25 AM12/28/10
to google-we...@googlegroups.com
@Entity
class A
{
       Set<B> bs;
}

@Entity
class B
{
      C c;
}

@Entity
class C
{
}

i didn't type annotation for brevity. from client, using requestFactory i can get Aproxy with Bproxy inside, say, from client i can get all Bproxy in one Aproxy, but in the Bproxy the CProxy is null. i want to know how can i get Cproxy too,  then i don't bother with another request to server.
any ideas?
thanks.

Thomas Broyer

unread,
Dec 28, 2010, 7:27:09 AM12/28/10
to google-we...@googlegroups.com
context.getAllAs().with("bs", "bs.c")

(the "bs" isn't required actually, you can use "bs.c" only, but then you might not have other fields of BProxy --haven't checked--, and I find it easier to read and understand with both "bs" and "bs.c")

Mike Guo

unread,
Dec 28, 2010, 9:22:11 AM12/28/10
to google-we...@googlegroups.com
thanks very much Thomas, again.

-sowdri-

unread,
Dec 28, 2010, 10:48:09 PM12/28/10
to google-we...@googlegroups.com
Fantastic Thomas! Thanks.
Reply all
Reply to author
Forward
0 new messages