Hi,

This is my first ever forum post. I really need some help with
understanding how to setup a GWT 2.0 Hibernate3 project. I understand
the GWT RPC mechanism and the problems with serializing Hibernate
POJOs. I would prefer to use DTO's rather than Gilead or Dozer. So
far, I have a Hibernate Project built with Maven2 in Eclipse using the
m2eclipse plugin and the HibernateTools plugin for Eclipse. I also
have a GWT 2.0 project built with the GWT plugin for Eclipse. I'm
using MySql as the RDBMS. What I don't understand is how to setup,
configure, and deploy the two projects in such a way that they can
communicate with each other.

Let's say with the above setup, I'm trying to persist a Person object
that has only an id, and a name as fields. In my Hibernate project, I
would create a Person.hbm.xml Hibernate mapping document, and then
generate the corresponding Hibernate Java POJO and MySql table. Then,
in my GWT project, I would create a serializable PersonDTO.java class
that can be sent 'across the wire' to and from the server via GWT RPC.
Then, for simplicity's sake, let's say that in the client package of
my GWT project I create a CreatePersonService.java interface and a
CreatePersonServiceAsync.java interface with one method, void
createPerson(). I would then need a CreatePersonServiceImp.java class
on the server side that implements createPerson(). Fine, but here's
where I get confused.

If the createPersonServiceImp.java class is going to transform a
PersonDTO.java class into its Hibernate POJO equivalent, then it needs
to utilize classes from both my GWT Eclipse project and Hibernate
Eclipse project. So which project do I put it in? It needs to have
access to GWT classes like PersonDTO, AsyncCallback and other RPC
classes. It also needs access to Hibernate classes like
SessionFactory, Transaction, etc. So it needs to have access to my GWT
jars and Hibernate jars which are in two separate projects. How do do
I link them so that CreatePersonServiceImp.java has access to all the
libraries it needs. Finally, how do I correctly merge both of these
projects into one WAR file for deploying onto a server? Or am I way
off track?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to