What is the best way of implementing a roundtrip for receiving XML files and eventually persisting the data into a database using Java. Currently I have:
1. An XML Schema & XML data files send to me
- the XSD is fairly complex and belongs to an external party, so I can not change it
2. Created the Java classes
- JAXB generates over 150 classes, unfortunately the schema can change
- I have used Maven POM to automate the process
3. Unmarshall the XML data files into Java objects (with JAXB annotation)
- the data would be displayed to the user to be manipulated
4. Persist the Java objects into a RDBMS (Oracle / MySQL)
- it seems JDO is the most suitable solution
5. Exporting the data
- The data can be exported again as XML or Excel (for example)
I can not find a suitable way to add JDO metadata or annotations to the Java source code (generated during the JAXB process) to ensure I can persist the Java classes. I am working with the following technologies:
- Java, Maven, JAXB, JDO & JDBC
I think DataNucleus would be most suited as I might have to change datastores (RDBMS / XML / Excel) often between environments with different export destinations. The only other two technologies I might need to consider is:
- Spring and XDoclet
Advice or a pointer to a tutorial would be appreciated