db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Baker" <gary.ba...@movielink.com>
Subject Private member foreignTableNames in org.apache.torque.engine.database.model.Table
Date Wed, 24 Sep 2003 00:13:16 GMT


I was fishing around looking trying to figure out why Torque won't
maintain a collection of child objects when I have a foreign key to the
same table and found this, probably unrelated, oddity.

Starting at line 511 of
org/apache/torque/engine/database/model/Table.java

   /**
     * Adds a new FK to the FK list and set the
     * parent table of the column to the current table
     *
     * @param fk A foreign key
     */
    public void addForeignKey(ForeignKey fk)
    {
        fk.setTable (this);
        foreignKeys.add(fk);

        if (foreignTableNames == null)
        {
            foreignTableNames = new ArrayList(5);
        }
        if (foreignTableNames.contains(fk.getForeignTableName()))
        {
            foreignTableNames.add(fk.getForeignTableName());
        }
    }

foreignTables is private, and this is the only place that it is added to
Am I losing my mind, or is it impossilble that foreignTableNames will
ever contain anything?
Shouldn't there be a bang in the second if statement????

None of this really matters, since no one is calling the getter for this
member and it's never really referenced from within table, but I thought
I'd bring it up anyhow...

-Gary

PS:  if someone tells me how, I'll fix it myself...

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message