Re: With GWT, when exactly do you need DTOs for your entities ?

2011-05-02 Thread dmen
There is a catch however! You cannot safely use CascadeType.MERGE with "ToMany" associations. If you do, JPA will automatically delete the nullified collections when you sent those entities back to the server. On May 2, 1:45 pm, dmen wrote: > I do use the same approach, though with Spring MVC Co

Re: With GWT, when exactly do you need DTOs for your entities ?

2011-05-02 Thread dmen
I do use the same approach, though with Spring MVC Controllers + XStream instead of GWT RPC. https://github.com/scumm/mojo/tree/master/mojo-dao/src/main/java/mojo/dao/util On May 1, 10:27 pm, Celinio wrote: > Thanks for pointing it out. > Well, apparently the author created a class, HibernateFil

Re: With GWT, when exactly do you need DTOs for your entities ?

2011-05-01 Thread Celinio
Thanks for pointing it out. Well, apparently the author created a class, HibernateFilter.java, that acts as a filter during the GWT serialization of objects. http://tocollege-net.googlecode.com/svn/ProGWT/trunk/src/main/java/com/apress/progwt/server/gwt/HibernateFilter.java It converts Date object

Re: With GWT, when exactly do you need DTOs for your entities ?

2011-05-01 Thread Juan Pablo Gardella
In the book Pro Web 2.0 Application Development with GWT the author don't use DTO. He *hack *some GWT classes to put null this relations during serialization . This is a good solutions because you don't duplicate your

Re: With GWT, when exactly do you need DTOs for your entities ?

2011-05-01 Thread Celinio
OK. But if you look at this entity, it has a onetomany relationship (manytoone more exactly) and there is no DTO mapped to it : http://code.google.com/p/gwt-hardwarestore/source/browse/trunk/%20gwt-hardwarestore/HardwareStore_2/src/com/hardwarestore/vo/Purchase.java What do you think ? On Sun, Ma

Re: With GWT, when exactly do you need DTOs for your entities ?

2011-05-01 Thread Ahmed Mohammed
You will be needing DTOs if in entities there are any one to many relationships.Or if you have any lazy load defined for any fields.Since GWT can't serialize those objects, it will throw unable serialize exception when you try to pass the entities from server to client. -Ahmed On May 1, 3:34 am, C

With GWT, when exactly do you need DTOs for your entities ?

2011-05-01 Thread Celinio
Hi, I need some clarification regarding the use of JPA entities within a GWT application. I have always read that you need to create a DTO for each entity that you develop in a GWT application because of some serialization problem. But if you look at this skeleton for a GWT-JPA application, you wi