|
From: Solomon D. <sd...@gm...> - 2013-06-05 12:12:43
|
IMHO, you're on the right track with this thought. To do this, you have to create a custom MessageBodyWriter + renderer. I've been working on something like this for a while now: https://github.com/skyscreamer/yoga. There's a lot of great use cases for this type of technology, as well as a handful of other implementations. -Solomon On Wed, Jun 5, 2013 at 12:49 AM, Jean Morissette <jea...@gm...>wrote: > Hi devs, > > Let's say we have a graph of many JPA entities that we would like to > expose as REST resources. > > Since the graph is pretty big, we want to send only small subgraphs at > time, allowing the user to navigate in the graph using links (HATEOAS). > > How would you implement this scenario? > > > > I have sketched a solution and I would really appreciate your comments on > it. > > - Create a class annotation @Summarizable and a field annotation @Summary. > > - Modify the behavior of the marshaller to break the graph in subgraph > where @Summarizable classes are found. > > - Except the root of the marshalled graph, when the marchaller encounters > an object marked as Summarizable, it would marshall only its fields marked > Summary and add a link to retrieve the full object. > > > Is-it something doable? Do you have a better solution? > > Regards, > Jean > > > > > > > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |