GWT 2.0 JPA hibernate enhanced

47 views
Skip to first unread message

PierreR

unread,
Feb 6, 2010, 6:03:36 AM2/6/10
to Google Web Toolkit
Hello,

I am still very confused about the enhanced serialized class "issue"
in GWT version 2.0.

I would like to use GWT for a CRUD application. One of the advantages
I can see over Flex, is the possibility to use shared entity java pojo
both on the client (detached) and the server. I don't want to use DTO
(even if there are generated with Dozer) or Gilead. The French book
"Programmation GWT 2" seems to say it does not work "as is" while
Google help seems to say the "issue" has been fixed in 2.0.

I know there is a solution called "objectify" for the App Engine but I
am using JPA/hibernate right now.

Thanks for your help.

PierreR

unread,
Feb 7, 2010, 2:17:20 AM2/7/10
to Google Web Toolkit
I can be a little more precise here.

GWT 2.0 will probably correctly serialize enhanced classes. But there
are case such as for List where Hibernate uses a PersistentBag to
implement List.

At that point, GWT will not be able to serialize/deserialize the class
containing the List field.

Is this right ?

Thanks

Thomas Broyer

unread,
Feb 7, 2010, 4:40:50 AM2/7/10
to Google Web Toolkit

On Feb 7, 8:17 am, PierreR <p.radermec...@gmail.com> wrote:
> I can be a little more precise here.
>
> GWT 2.0  will probably correctly serialize enhanced classes. But there
> are case such as for List where Hibernate uses a PersistentBag to
> implement List.

Hibernate doesn't do "enhanced classes", or rather it does it "on the
fly". That's why (AFAIK) Gilead or similar solutions are needed.
If you wonder what "enhanced classes" then means, have a look at
DataNucleus: http://www.datanucleus.org/products/accessplatform/bytecode_enhancement.html
DataNucleus uses a simple ArrayList, which GWT knows how to serialize.

I just did a prototype with DataNucleus (JDO though, not JPA, but it
makes no difference in DataNucleus actually) and it "just works". I've
never used Hibernate in a "GWT context" though, so I cannot compare.

stam

unread,
Feb 7, 2010, 9:16:36 AM2/7/10
to Google Web Toolkit
I've actually used both and frankly I have been pretty disappointed
with DataNucleus (the JDO/JPA impl that comes with the app engine).
Although using JDO annotations on datanucleus was successful from a
POC point of view, but I couldn't for the love of god get the POJO
attach/detach mechanism to work, something that is crucial when you
have to send objects down to the client, have them sent back with
changes and updated into the datastore. The testcase posted on
datanucleus' website didn't work for me for this scenario and no one
on their forum could advice me on why it was failing.

I've hence abandoned datanucleus for hibernate + gilead. Hibernate
supports JPA annotations as well along with some extentions. I am a
happy clam now :)

The current roadblock I see with GWt and the data model is the absence
of a data binding framework that I can use to bind POJOs to elements
such as grid/tree etc. If I find something that does that (and is
freeware), I'm going to send the author a box of chocolates.

Reply all
Reply to author
Forward
0 new messages