View
• Attachments (0)
• Info
- First of all we clean up by removing the target directory (since it may contain some old stuff we don't need).
- Then the build system invokes the schema compiler together with Hyperjaxb3 plugin. During this step JAXB will generate schema-derived classes and Hyperjaxb3 will extend these classes with ORM annotations or mappings to make these classes JPA-persistable. In JPA terminology, generated schema-derived classes together with their ORM mappings build up a persistence unit.
- After we're done with code generation, we'll compile what we have.
- When the code is compiled, the build system will execute the tests. The only test we have by default in the basic project template is the generated RoundtripTest. This test will execute the following steps:
- The roundtrip test will create a JPA entity manager with the persistence unit we produced out of our XML Schema and properties loaded from the src/test/resources/persistence.properties.
- It will iterate over the *.xml files found in the src/test/samples directory.
- For each of the sample, the roundtrip test will unmarshall the XML into an object.
- Unmarshalled object will be saved into the database using the entity manager.
- After out inital object is saved, it will be loaded back (but in a different transaction).
- Loaded object will be marshalled back to XML and then compared to the initial XML sample.
- In case there are any differences, the rountrip test will fail.