I am new to JiBX. I am trying to read an XML document, marshall it to Java Objects (POJO's) and persist them using hibernate.
Here's an example of what I am trying to do: A Person can have many addresses
<person>
<name>Joe</name>
<address type="home">
<street>Home street</street>
</address>
<address type="business">
<street>Office street</street>
</address>
</person>
I have POJO's for Person and Address created (which are hibernate friendly)
public class Person {
private string name;
Set addresses;
// No arg constructor
// Getters and Setters etc.
}
public class Address {
private string type;
private string street;
private Person addressFor;
// No arg constructor
// Getters and setters
}
When I use JiBX and marshall my XML document and try to persist it, I get an NullPointerException because the addressFor field in Address object is not getting set.
Any ideas on how I can do this?
I appreciate your help!!
Thanks
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users