Object-Relational Mapping ========================= Here we describe our Object-Relational mapping strategy, mapping the OO UML model to a relational database schema. For now (2008-04-13), we are using an implicit mapping strategy, i.e. we do not support explicit mapping indicators in the UML model or elsewhere. This implies that we need to choose a single strategy when generating DDLs and JPA mapping for the generated Java classes for example. The following is a list of choices we have made. 1. single bigint/long ID column, supported by a Long id field on the MetadataObject base class. 2. inheritance: choices are (i) single table for complete inheritance hierarchy (ii) joined tables (iii) single, complete table per class. (i) implies we need to join all columns from all classes in an inheritance hierarchy in a single class. It also implies we need to include a "class" column. This must be taken into account by ADQL queries. (ii) is easiest to generate using XSLT as only the contents of a given class have to be taken into account. (iii) is easiest to query using ADQL. 3. if we choose multiple types in a single table, then we are in general unable to use "not null" constraints on columns. For though this may be applicable for some of the subclasses, for which the column is defined, for others this is not the case. 4. Attributes whose type is a complex datatype, i.e. a datatype with attributes, are mapped to multiple columns, each corresponding to an attribute of the DataType. This is applied recursively in case the datatype's attributes are themselves complex data types.