Overview

This library contains object for data binding to standard IVOA schema. The XML binding technology that is used is JAXB2.

The objects are originally automatically generated from the schema, but now include specific customizations so that when the schema change the objects will have to have these customizations reapplied - fortunately JAXB2 annotations make this process relatively painless. The schema that these objects will bind to are all contained in the "astrogrid contracts" project.

More information on using the classes is given in the javadocs.

Database binding

There is additionally a JPA binding for the objects that allows the objects to be persisted into a relational database.

Although in principle using JPA means that any JPA provider can be used with these classes, in fact the mapping has been done by using a few eclipselink specific features, so that only eclipselink is supported in the current version.

The JPA mapping can be done in many ways because of the flexibility of JPA. In general the mapping was performed to reduce the number of tables as much as possible, with the following specific strategies.

  • An entity was treated as embedded wherever the multiplicity was 1:1
  • Added an ID field where necessary - i.e. all freestanding tables (appropriate JAXB markup was used to stop these IDs being written to XML)
  • Used single table represent type hierarchy with a column (KIND) to distinguish the types
  • Lists of enumerations have been converted to a comma separated set of values in a string.
  • One to many relationships have been modeled by putting a back-reference into the many end so that can be annotated for the foreign key