Tony: I tried a while back to get Cayenne returned objects to output xml using the Jersey REST services. They did not behave well because of the inheritance model _myobj and mybobj that Cayenne uses.
There was a discussion on this on the group about alternative solutions but I never really got it to work. I did not understand enough of the topic to delve into fixing it. Some of the team said they may be able to code a fix-I love Cayenne but the work I am doing needs to serve web content and REST content... Tony ----- Original Message ----- From: "Tony Giaccone" <[email protected]> To: [email protected] Sent: Thursday, August 25, 2011 7:57:10 AM Subject: Re: Webservice and Cayenne Andrus, I'm curious why you are using the tapestry IoC container. What purpose does it serve? Tony Giaccone Life is what you live today. On Aug 24, 2011, at 5:07 PM, Andrus Adamchik <[email protected]> wrote: > I am using Cayenne with Jersey frontend (http://jersey.java.net/ ) and a > Tapestry 5 IoC container in between. Jersey is a JAX RS implementation and > can serialize objects based on standard JAXB annotations, generating either > XML or JSON. > > While there's no direct JAXB bindings for Cayenne DataObjects, I'd use very > simple annotated DTO's converting between Cayenne and DTO in each Jersey > resource class. > > What I find interesting is that the DTO conversion is not simply a workaround > for the lack of direct serialization. It actually allows to bridge the > mismatch between the DB schema and the desired end user format of the output. > > Like the above stack a lot - very simple and clean frontend code, ties nicely > to fairly abstract backend business logic, very little configuration. > > Andrus > > > On Aug 24, 2011, at 7:51 PM, Tony Giaccone wrote: >> I'm interested in implementing a Restful web service using Cayenne as the >> backing ORM. My guess is that there are some people on this list who may >> have opinions on how might best be implemented. My intent is to vend json to >> the clients. I know that ROP and the hessian protocol are actively being >> used, but I don't think those have a place in what I want to build (no jvm >> on client side). >> >> In particular there I've seen some discussions about using DTO's and custom >> template generation. I'm especially interested in how this is accomplished. >> >> Anyone care to comment? >> >> >> Tony Giaccone >
