commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <>
Subject [betwixt] How to achieve self-contained mappings for sub beans ?
Date Sun, 27 Mar 2005 15:54:20 GMT
While playing around with betwixt (newest from SVN), I found some
strange (I think) constraint. Consider the TestMultiMapping unit test
with PartyBean and AddressBean, where the former has a sub object
venue that is an AddressBean.
Now the mapping file specifies

<element name="location" property="venue"/>

which results in a sub-element location for the AddressBean instance
despite the fact that the mapping for AddressBean specifies the
"address" element.
While I can see a reason why one would want to change the XML element
for a sub object, I'd like to specify the simpler case where the
element that is defined in the mapping of the AddressBean is used,

<element property="venue"/>

This way, the mapping for AddressBean is self-contained and can be
used as-is by other mappings.
However, I get a SAX exception stating that the name attribute is
required (it obviously only works for collections, not for
Is there any way that I can avoid the specification of the element
name when stating a mapping for a sub object ?


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

View raw message