// Check if there is table inheritence going on, and if so create the super table first
BaseDef base = omdb.getDBDef();
if ( base instanceof TableDef ) {
TableDef table = (TableDef) base;
InheritenceDef inheritence = table.getInheritence();
if ( inheritence != null ) {
ObjectMappingDB smom = (ObjectMappingDB) omdb.getSuperMapping();
// Set the discriminator values
if ( inheritence.getDiscriminatorName() != null ) {
MetaField df = omdb.getField( inheritence.getDiscriminatorName() );
df.setString( o, inheritence.getDiscriminatorValue() );
}
// Create the super classes table entry
if ( !create( c, mc, smom, o )) {
throw new SQLException( "Super table entry could not be created for mapping [" + smom + "]" );
}
// Set the mapping field
MetaField rf = omdb.getField( inheritence.getRefColumn() );
MetaField f = omdb.getField( inheritence.getColumnName() );
f.setObject( o, rf.getObject( o ));
}
}
// Now create the entry for this object