You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Gary Baker <ga...@movielink.com> on 2003/09/23 22:54:04 UTC

Tables with foreign keys to themselves don't maintain Lists of related rows.

I've got a table with a foreign key to itself. 

Shouldn't the BaseXXX class maintain a List of related rows based on
that foreign key...

For example... 

<table name="XXX">
        <column name="XXX_ID" type="VARCHAR" size="40"
primaryKey="true"/>
        <column name="SUPER_ID" type="VARCHAR" size="40"/>
        <foreign-key foreignTable="XXX">
            <reference local="SUPER_ID" foreign="XXX_ID"/>
        </foreign-key>
</table>

Shouldn't there be a property on BaseXXX called collXxx of type List??
(there isn't one)
There are other tables with foreign keys to this table and such Lists
exist for those tables.
I'm using version 3.1?
Is this by design?  Or is this a short-coming?

Thanks,
-Gary

Re: Tables with foreign keys to themselves don't maintain Lists of related rows.

Posted by Dave Newton <da...@solaraccess.com>.
On Tue, 2003-09-23 at 16:54, Gary Baker wrote:
> I've got a table with a foreign key to itself. 

I'm definitely not an SQL guru (I write printers, fer gosh's sake :)
but... isn't a foreign key by definition a key in another table?

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org