Hi,
I desperatly try to map a ordered TreeMap.
(It works fine if this map is a basic HashMap)
The mapping :
[...]
<class name="com.mycompany.myproduct.FormRadio">
<field name="radios" collection="hashtable">
<bind-xml name="radio">
<class name="org.exolab.castor.mapping.MapItem">
<field name="key" type="java.lang.String">
<bind-xml name="key" node="attribute" />
</field>
<field name="value" type="java.lang.String">
<bind-xml node="text"/>
</field>
</class>
</bind-xml>
</field>
</class>
[...]
The class :
import java.util.Map;
public class FormRadio extends FormField {
private Map radios = null;
[...]
public Map getRadios() {
return radios;
}
public void setRadios(Map radios) {
this.radios = radios;
}
}
The "radios" map on FormRadio class is a TreeMap, based/ordered on a Java
Comparator.
It doesn't really fail, but the "value" fields of my TreeMap are not
outputed.
(only the keys are outputed in attribute, as specified).
Even if i replace :
1) collection="hashtable" ... by : collection="map"
2) <bind-xml node="text"/> ... by : <bind-xml name="value"
node="attribute"/>
Thanks in advance for any workaround, or any suggestion about a matching
mapping file.
;-)