Mam taki wygenerowany przez JAXB xml dla listy obiektow :
<relationships>
<relationship id="1">
<type>NEUTRAL</type>
<current>false</current>
<children>
<child sim="1" isAdopted="false"/>
</children>
</relationship>
<relationship id="2">
<type>NEUTRAL</type>
<current>false</current>
<children>
<child sim="2" isAdopted="false"/>
</children>
</relationship>
</relationships>
Problem pojawia sie przy odczycie go. ladujac do programu wartosc SIM jest nullem.
Tak wygladaja adnotacje dla tej listy :
@XmlElementWrapper(name = "children")
@XmlElements({@XmlElement(name = "child", type = Child.class)})
private ObservableList<Child> children = FXCollections.observableArrayList();
Natomiast w samej classie Child
@XmlIDREF
@XmlAttribute
public Sim getSim() {
return sim.get();
}
@XmlAttribute
public boolean isIsAdopted() {
return isAdopted.get();
}
Gdy zapisuje liste samych obiektow Sim to zapisuje i odczytuje sie prawidlowo. Problem jest jedynie wtedy gdy je owrappuje w klase child.
Co robie zle ?