Do I have to use DTO if I use GWT + JPA?

53 views
Skip to first unread message

Warren Tang

unread,
Sep 25, 2011, 10:21:00 PM9/25/11
to google-we...@googlegroups.com
Some say transferring entities cross the wire may cause problems, e.g. lazy loading. 

But I feel reluctant to introduce DTO. It's boilerplate and it's not right.

I also looked at RequestFactory and it seems a solution. However I'm also using GWTP's command pattern, which doesn't seem to work with RequestFactory.

Is there any alternatives? Do I have to use DTO?

Behi

unread,
Sep 25, 2011, 10:55:51 PM9/25/11
to Google Web Toolkit
Lazy loading won't work on the client side as the JPA session is only
maintained on the server side and only detached objects are sent down
to the client. You would need to use DTOs and send the fully-loaded
domain objects to the client.

Warren Tang

unread,
Sep 25, 2011, 11:11:30 PM9/25/11
to google-we...@googlegroups.com
Thanks for your reply. I also read this:

http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html

It seems that I have to go DTO anyway.

--
Regards,
Warren Tang

ricu

unread,
Sep 26, 2011, 2:42:10 AM9/26/11
to Google Web Toolkit
Did you try GILEAD? It permits you to send Persistent entities over
the RPC.

On 26 ruj, 05:11, Warren Tang <warren.c.t...@gmail.com> wrote:
> Thanks for your reply. I also read this:
>
> http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html
>
> It seems that I have to go DTO anyway.
>
> --
> Regards,
> Warren Tang <http://blog.tangcs.com>

J.Ganesan

unread,
Sep 26, 2011, 7:19:06 AM9/26/11
to Google Web Toolkit
You may find DataStoreGwt handy. It has lazy loading and does away
with DTO.

J.Ganesan
www.DataStoreGwt.com

On Sep 26, 8:11 am, Warren Tang <warren.c.t...@gmail.com> wrote:
> Thanks for your reply. I also read this:
>
> http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html
>
> It seems that I have to go DTO anyway.
>
> --
> Regards,
> Warren Tang <http://blog.tangcs.com>

Juan Pablo Gardella

unread,
Sep 26, 2011, 7:24:20 AM9/26/11
to google-we...@googlegroups.com
See this thread

2011/9/25 Warren Tang <warren...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/xdLeM3KY-FcJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Warren Tang

unread,
Sep 26, 2011, 9:41:34 AM9/26/11
to google-we...@googlegroups.com
Thanks for your suggestions. I'll look into Gilead or something like
Hibernate Filter (though I use EclipseLink).
Reply all
Reply to author
Forward
0 new messages