Friday, January 27, 2012

Re: save data to database with hibernate and rpc

I think the best way is use RequestFactory. Forguet DTO's or third party librarys

2012/1/27 Sebastian Gurin <sgurin@softpoint.org>
I agree with you about gilead intrusiveness. Also I see the project is not mantained any more. In my case I didn't get it to work, but google's using_gwt_with_hibernate.html document refer to it as a sollution. That is why I recommended it.

I will keep investigating Hibernate filter for future gwt+hibernate projects. Thanks for the info.

Regards.

On Fri, 27 Jan 2012 00:03:06 -0300
Juan Pablo Gardella <gardellajuanpablo@gmail.com> wrote:

> Instead of use gilead (to me intrusive), you can use Hibernate filter. See
> http://groups.google.com/group/google-web-toolkit/browse_thread/thread/7e46e8c33e7ee5da
>
> El 26 de enero de 2012 20:56, Sebastian Gurin <sgurin@softpoint.org>escribió:
>
> > Hi I developed my web apps gwt and persist the model with hibernate. You
> > have lot of articles about it
> >
> >
> > http://code.google.com/intl/es-ES/webtoolkit/articles/using_gwt_with_hibernate.html
> >
> > my advice:
> > The main problem you will encounter is compatibility issues between model
> > object managed by hibernate and gwt rpc java object serialization.
> >
> > Hibernate poblate your bean classes using datatypes unsupported by gwt
> > rpc. Gwt rpc only understand common java type implementations ( like
> > HashMap, HashSet ) . In particular, in many-relationships, if you configure
> > hibernate with lazy="false" for automatically loading collection
> > properties, hibernate will use java.lang.Set implementation unsupported by
> > gwt rpc serialization.
> >
> > I recommend you tu use data transfer objects (DTO) object to wrap your
> > real model classes.
> >
> > If you really wnt to use your existing java model directly with hibernate
> > and gwt rpc, you have choices:
> >
> > 1) use a library like http://noon.gilead.free.fr/gilead/.
> > 2) do not let hibernate manage collections:
> >        - Use lazy="true" in hiberate
> >        - Make your DAO or BL classes API to provide with methods for
> > retrieving many-relations - like List<Apple> getApples(long treeId); make
> > sure those methods return objects compatible with gwt rpc (like LinkedList,
> > HashSet, etc)
> >
> > good look
> >
> > On Thu, 26 Jan 2012 11:32:54 -0800 (PST)
> > odon <odon.d.ace@gmail.com> wrote:
> >
> > > hii...
> > > i need help ...
> > > i get problem with save data to database with hibernate.
> > > when i executed the event, i always get on failure
> > > this is the code...
> > >
> > > Button btn= new Button("create");
> > > btn.addClickHandler(new ClickHandler() {
> > >                       public void onClick(ClickEvent event) {
> > >                               Info info= new Info();
> > >                               info.setId(null);
> > >                               info.setUsername(txtbxUsername.getText());
> > >
> > info.setPassword(passwordTextBox.getText());
> > >                               infoService.saveInfo(info, new
> > AsyncCallback<String>() {
> > >
> > >                                       @Override
> > >                                       public void onSuccess(String
> > result) {
> > >                                               // TODO Auto-generated
> > method stub
> > >                                               Window.alert("success");
> > >
> > >                                       }
> > >
> > >                                       @Override
> > >                                       public void onFailure(Throwable
> > caught) {
> > >                                               // TODO Auto-generated
> > method stub
> > >                                               Window.alert("fail"+
> > caught.getMessage());
> > >                                       }
> > >                               });
> > >                       }
> > >               });
> > >
> > > how to make it on success?
> > > please your help :)
> > >
> > > --
> > > 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.
> > >
> >
> >
> > --
> > Sebastian Gurin <sgurin@softpoint.org>
> >
> > --
> > 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.
> >
> >
>
> --
> 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.
>


--
Sebastian Gurin <sgurin@softpoint.org>

--
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.




--
ISC. Daniel Mauricio Patiño León.
Director ejecutivo
Liondev S.A. de C.V.



--
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.

No comments:

Post a Comment