What is the best way to implement roundtrip to retrieve XML files and, ultimately, save data to a database using Java. Currently I have:
1. The XML schema and XML data files are sent to me
- XSD is quite complex and belongs to the outside, so I can’t change it
2. Java classes are created
- JAXB generates more than 150 classes, unfortunately, the schema can change - I used Maven POM to automate the process 3. Unmarshall XML data files into Java objects (with JAXB annotation)
- the data will be displayed to the user who needs to be manipulated
4. Reassign Java objects to RDBMS (Oracle / MySQL)
- it looks like JDO is the most suitable solution
5. Export data
- Data can be exported again as XML or Excel (for example)
I cannot find a suitable way to add JDO metadata or annotations to the Java source code (generated during the JAXB process) so that I can save Java classes. I work with the following technologies:
- Java, Maven, JAXB, JDO and JDBC
I think DataNucleus would be the most suitable, since I might have to change data warehouses (RDBMS / XML / Excel) often between environments with different export points. The only other two technologies that I may need are: - Spring and XDoclet
Tip or pointer to a tutorial will be appreciated
source
share