docs: private void addIndirectionTable(CollectionDescriptorDef collDef)
      {
          String   tableName = collDef.getProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE);
          TableDef tableDef  = getTable(tableName);
  
          if (tableDef == null)
          {
              tableDef = new TableDef(tableName);
              addTable(tableDef);
          }
          if (collDef.hasProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE_DOCUMENTATION))
          {
              tableDef.setProperty(PropertyHelper.OJB_PROPERTY_TABLE_DOCUMENTATION,
                                   collDef.getProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE_DOCUMENTATION));
          }
  
          // we add columns for every primarykey in this and the element type
          //   collection.foreignkeys        <-> ownerclass.primarykeys
          //   collection.remote-foreignkeys <-> elementclass.primarykeys
          // we also add foreignkeys to the table
          //   name is empty (default foreignkey)
          //   remote table   = table of ownerclass/elementclass
          //   local columns  = columns in indirection table 
          //   remote columns = columns of corresponding primarykeys in ownerclass/elementclass
          ClassDescriptorDef ownerClassDef    = (ClassDescriptorDef)collDef.getOwner();
          ModelDef           modelDef         = (ModelDef)ownerClassDef.getOwner();
          String             elementClassName = collDef.getProperty(PropertyHelper.OJB_PROPERTY_ELEMENT_CLASS_REF);
          ClassDescriptorDef elementClassDef  = modelDef.getClass(elementClassName);
          ArrayList          localPrimFields  = ownerClassDef.getPrimaryKeys();
          ArrayList          remotePrimFields = elementClassDef.getPrimaryKeys();
          String             localKeyList     = collDef.getProperty(PropertyHelper.OJB_PROPERTY_FOREIGNKEY);
          String             remoteKeyList    = collDef.getProperty(PropertyHelper.OJB_PROPERTY_REMOTE_FOREIGNKEY);
          String             ownerTable       = getTargetTable(ownerClassDef, tableName, localKeyList);
          String             elementTable     = getTargetTable(elementClassDef, tableName, remoteKeyList);
          CommaListIterator  localKeys        = new CommaListIterator(localKeyList);
          CommaListIterator  localKeyDocs     = new CommaListIterator(collDef.getProperty(PropertyHelper.OJB_PROPERTY_FOREIGNKEY_DOCUMENTATION));
          CommaListIterator  remoteKeys       = new CommaListIterator(remoteKeyList);
          CommaListIterator  remoteKeyDocs    = new CommaListIterator(collDef.getProperty(PropertyHelper.OJB_PROPERTY_REMOTE_FOREIGNKEY_DOCUMENTATION));
          ArrayList          localColumns     = new ArrayList();
          ArrayList          remoteColumns    = new ArrayList();
          boolean            asPrimarykeys    = collDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE_PRIMARYKEYS, false);
          FieldDescriptorDef fieldDef;
          ColumnDef          columnDef;
          String             relationName;
          String             name;
          int                idx;
  
          for (idx = 0; localKeys.hasNext(); idx++)
          {
              fieldDef  = (FieldDescriptorDef)localPrimFields.get(idx);
              name      = localKeys.getNext();
              columnDef = tableDef.getColumn(name);
              if (columnDef == null)
              {
                  columnDef = new ColumnDef(name);
                  tableDef.addColumn(columnDef);
              }
              columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_TYPE, fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE));
              columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_SIZE, fieldDef.getSizeConstraint());
              if (asPrimarykeys)
              {
                  columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_PRIMARYKEY, "true");
              }
              if (localKeyDocs.hasNext())
              {
                  columnDef.setProperty(PropertyHelper.OJB_PROPERTY_COLUMN_DOCUMENTATION, localKeyDocs.getNext());
              }
              localColumns.add(name);
              remoteColumns.add(fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN));
          }
          if (collDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_DATABASE_FOREIGNKEY, true))
          {
              relationName = collDef.getProperty(PropertyHelper.TORQUE_PROPERTY_RELATION_NAME);
              if ((relationName != null) && (ownerTable != null))
              {
                  tableDef.addForeignkey(relationName, ownerTable, localColumns, remoteColumns);
              }
          }
          localColumns.clear();
          remoteColumns.clear();
  
          for (idx = 0; remoteKeys.hasNext(); idx++)
          {
              fieldDef  = (FieldDescriptorDef)remotePrimFields.get(idx);
              name      = remoteKeys.getNext();
  
              columnDef = tableDef.getColumn(name);
              if (columnDef == null)
              {
                  columnDef = new ColumnDef(name);
                  tableDef.addColumn(columnDef);
              }
              columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_TYPE, fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_JDBC_TYPE));
              columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_SIZE, fieldDef.getSizeConstraint());
              if (asPrimarykeys)
              {
                  columnDef.setProperty(PropertyHelper.TORQUE_PROPERTY_PRIMARYKEY, "true");
              }
              if (remoteKeyDocs.hasNext())
              {
                  columnDef.setProperty(PropertyHelper.OJB_PROPERTY_COLUMN_DOCUMENTATION, remoteKeyDocs.getNext());
              }
              localColumns.add(name);
              remoteColumns.add(fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_COLUMN));
          }
  
          CollectionDescriptorDef elementCollDef = collDef.getRemoteCollection();
  
          if (((elementCollDef != null) && elementCollDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_DATABASE_FOREIGNKEY, true)) ||
              ((elementCollDef == null) && collDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_DATABASE_FOREIGNKEY, true)))
          {
              relationName = collDef.getProperty(PropertyHelper.TORQUE_PROPERTY_INV_RELATION_NAME);
              if ((relationName != null) && (elementTable != null))
              {
                  tableDef.addForeignkey(relationName, elementTable, localColumns, remoteColumns);
              }
          }
      }