return mapping;
}
// Get the table that we want our column to be a FK to
// This could be the owner table, element table, key table, value table etc
DatastoreClass destinationTable = storeMgr.getDatastoreClass(javaType.getName(), clr);
if (destinationTable == null)
{
// Maybe the owner hasn't got its own table (e.g "subclass-table" inheritance strategy)
AbstractClassMetaData ownerCmd = storeMgr.getOMFContext().getMetaDataManager().getMetaDataForClass(javaType, clr);
AbstractClassMetaData[] ownerCmds = storeMgr.getClassesManagingTableForClass(ownerCmd, clr);
if (ownerCmds == null || ownerCmds.length == 0)
{
throw new JPOXUserException(LOCALISER.msg("057023", javaType.getName())).setFatal();
}
// Use the first one since they should all have the same id column(s)
destinationTable = storeMgr.getDatastoreClass(ownerCmds[0].getFullClassName(), clr);
}
if (destinationTable != null)
{
// Foreign-Key to the destination table
JavaTypeMapping m = destinationTable.getIDMapping();
// For each datastore mapping, add a column.
ColumnMetaDataContainer columnContainer = null;
if (columnMetaData != null && columnMetaData.length > 0)
{