Hi Benson

It appears to be quite a common query.
I think, ultimately, JBoss JAXB introductions could be of help but apprently 
they don't support dynamic proxies for 'XmlTransient.
What I'm working upon in the background is for letting users to specify, by listing a list of names (possibly fully qualified) which have to be dropped, as a property on (default) JAXB/JSOn providers.
So the intermediate option is to register a custom JSONProvider which extends 
the one we ship and which overrides

getStreamWriter() method, which will return a custom writer configured to drop 
everything in Parent but its id.

I'm not sure how efficient it can be with hibernate, that is I'm not sure if blocking at the XMlStreamWriter level will prevent JAXB/hibernate from executing futile db queries under the hood
Give it a try though please, I'd be interested to know if it helps

Sergey


Starting from hibernate, I seem to have engineered myself into a small
corner.

class Parent {
 int id; // public property fcns available
};

class Child {
 int id;
Parent parent;
};

What I want in the JSON is the parent's ID, not an entire dump of the
parent. Using jackson, there might be an annotation to fix this, but since
the java is generated by hibernate, and the doc on this area in hibernate is
awful, I don't much want to go there. There's nothing generic to JAX-RS for
dealing with this, is there?


Reply via email to