Sorry, maybe I couldn't explain well what I mean. I was looking at the tutorial http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html for GWT and Hibernate where the DTO's are created after the entities are extracted using JPQL. If using Java SE, GWT servlet and client are in the same application and I was able to import client DTO into servlet and to extract data from entities directly into DTO object [createQuery("SELECT new DTOobject(s.field_1, s.field_2) from MyJPAentity s")] (I'm using OpenJPA) Thus eliminating the need to iterate through extracted entities and assign them to DTO objects. The result List of this query was already a List of DTO objects and I was sending it directly to my GWT client for processing. If using Java EE, web application where I have GWT module is separate from EJB where I extract data from entities. So I have to first extract the entities then in the servlet I have to iterate through the result and assign it to DTO objects, like in the tutorial mentioned above. I wouldn't need to do this later operation if I had an import statement of DTOobject from GWT in my session Bean. I would pass to the servlet List of DTOobjects instead which wouldn't need extra processing. Is it possible to declare import statement of the GWT DTOobject in the session Bean of the EJB module? Thanks
On Sep 4, 11:51 pm, Dalla <[email protected]> wrote: > I´m not sure I completly understand your question, but this I know: > You cannot use an EJB with annotations on the GWT client side, > since GWT does not emulate javax.persistence.* > > To reuse existing EJBs, you´ll have to map them to a POJO DTO and then > transfer it to the client side. > A mapping framework like Dozer can help you with this, > > On 4 Sep, 16:53, MamboJumbo <[email protected]> wrote: > > > > > I searched this DTO question for a while but could not find a an > > answer. Maybe you know guys? Is it possible to import a GWT DTO class > > defined in the GWT client package in the EJB session bean, so that DTO > > can be instantiated in the session bean? If we had a dynamic web > > project with GWT and an EJB project with session beans. > > Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
