PDA

View Full Version : New project - need Hibernate advice



MartinElkjaer
21 Oct 2008, 10:11 PM
Hi,

We're in the startup fase of a new project and we're planning to use GXT+GWT+Hibernate+MySQL (and maybe Hibernate4GWT). At the moment our biggest concern is about the persistence layer and the integration/mapping between clientside and serverside.

I've read this blog-post: http://extjs.com/blog/2008/07/14/preview-java-bean-support-with-ext-gwt/ (http://extjs.com/forum/../blog/2008/07/14/preview-java-bean-support-with-ext-gwt/) and it seems this is the way to go, but we still have some questions:
How can we use this in combination with Hibernate4GWT ? And should we ?
We only want 1 domain model for the project - is this possible ? Or do we have to maintain both a serverside and a clientside model ?
Best practice ? What are you guys doing in your projects ?Hopefully some of you can give us some advices upfront, so we get the best design at first shot :-?


Best regards
Martin

jeremia.morling
23 Oct 2008, 5:01 AM
Hi!
I am also using the combination you mentioned (GWT + GXT + Hibernet4gwt + Hibernate + MySQL), though not with beans.

I am in the startup phase of the project myself.
I would advice you to use Hibernate4gwt, though I do not know anything about beans.
It works fine to only have 1 domain model. The easiest way is to create a package outside the client and server packages and call it "domain" or "shared".
Then you just specify that the client should read those source files as well. You do this in your gwt.xml file:

<source casesensitive="true" defaultexcludes="yes" path="client"/>
<source casesensitive="true" defaultexcludes="yes" path="shared"/>

(if you do not specify "source", the client path is automatically added by default. BUT! If you specify a "source", the client source path is not added automatically).

I am sorry that I can not help you anything with the bean stuff.
I was thinking about using beans also, but after some research I concluded that it would be too much for me to learn at the same time and that it would complicate my application for no obvious use. :)

I would be happy to help you out in any way I can.