Importing XML data to a RDBMS

exercise No. 20

Reading XML, write using JPA


Read the given XML data example using JAXB and persist the corresponding objects to a RDBMS. This requires the following steps:

  • Use the JAXB schema compiler xjc accordingly to create domain classes corresponding to <catalog> and <cd> .

  • Create a JAXBContext and an Unmarshaller instance to parse valid <catalog> instances accordingly.

  • Supply JPA annotations to the xjc generated class.

Hint: The Maven archetype standalone-jpa-eclipselink-archetype may help getting started with JPA configuration issues. You may want to add to your list of archetype repositories.