commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: betwixt 0.7RC2 suppress elements
Date Wed, 13 Jul 2005 20:07:14 GMT
On Tue, 2005-07-12 at 11:58 +0200, Jan Ole Brenna wrote:
> I'm using betwixt to transfer my object graph to xml. The objekt graph are
> persistent pojo beans managed by hibernate.
> My problem is that betwixt traverses the complete objekt graph, triggering
> hibernate to load all lazy collections. And I'm ending up with almost
> loading the whole database.
> I don't wont that, I would like to prevent betwixt from traversing the lazy
> parts of my graph.


> Hibernate has a method to check if a lazy collection is loaded, in order to
> use this method I have to have the value for a given property(element).

> PropertySuppressionStrategy.suppressProperty can't be used since values of
> properties are not known at that time (of course).

yes, property suppression is a introspection time activity. 

> The method for suppressing attributes:
> ValueSuppressionStrategy.suppressAttribute(AttributeDescriptor
> attributeDescriptor, String value) can't be used since it is called for
> simple properties only. (And I don't want the output
> beanWriter.getXMLIntrospector().getConfiguration().setAttributesForPrimitive
> s(true) gives)

i think that it should be called for all attributes but i agree it can't
serve your purpose...

> If I had a method for suppressing elements eg:
> boolean suppressElement(xxxx, Object value){
> and this metod was checked before writing every element this would be simple
> to achive.

should be easy to add this feature but i'm pretty busy at the moment
(i'm at apachecon next week) so if you need it quick then i suggest you
get hold of the source and do the necessary...

- robert

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message