Hi!
I have followed the HOW-TO instructions about wrapping a collection within a
wrapper element .by setting the container attribute of the castor field
element to false.
Nice!! I am can wrap all occurrences of some type into one single
collection element in XML :-)
But there is one drawback, unfortunately. I don't have control in the
element name of one occurrence within a collection wrapper element.
i.e.
public class Company {
//properties, interpret in terms of getter and setter
name
street
}
Castor class mapping:
<class name="Company" ....>
<map-to name="company"/>
// mapping for each property (straight forward)
</class>
public class MarketWatchDog {
// properties
List<Company> getCompanies(){...}
}
Castor class mapping for MarketWatchDog:
<class name="MarketWatchDog" ....>
<map-to name="market-watch-dog" />
// mapping for each property (straight forward)
<field name="companies"
collection="arraylist"
container="false"
type="Company">
<bind-xml name="companies" />
</field>
</class>
When marshalling I get the following XML structure:
....
....
<market-watch-dog>
<companies>
<company>
<name>Acme</name>
<street>Penn avenue</street>
</company>
<company>
<name>Minisoft</name>
<street>Jupiter avenue</street>
</company>
</companies>
</ market-watch-dog>
....
....
....
What I want, is to rename the element name "company" to "potential-company".
Example:
....
....
<market-watch-dog>
<companies>
<potential-company>
<name>Acme</name>
<street>Penn avenue</street>
</potential-company>
<potential-company>
<name>Minisoft</name>
<street>Jupiter avenue</street>
</potential-company>
</companies>
</ market-watch-dog>
....
....
....
Apparantly Castor uses the bind name of the class declared in the field
element.
Is there a way to let Castor know I want to use "potential-company" instead
of "company" as element name for each collection item like the example
above?
Kind Regards,
Urso Wieske
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email