Saturday, May 22, 2010

Re: GWT Hibernate Project Structure

Hi,

Do you have a reason for splitting the application into two projects?
If not, there is nothing preventing you from using a single project
for both client and server. If you do need to have two projects, you
can use two (server and client) or three (server, client and common)
modules under one maven project and define the dependencies among them
(if you hadn't used Maven, you could have used the IDE to define the
dependencies between projects). I suggest you read the documentation
here: http://code.google.com/eclipse/docs/users_guide.html

On May 21, 6:20 am, Maurice Nee <lyden...@gmail.com> wrote:
> 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 google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/google-web-toolkit?hl=en.

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate