>From a logical view point, these foreign key references don't make logical 
sense.  You have a column on one table that has RI to two different columns 
on another table.  This would mean that the values in those two different 
columns must be equal.  Why would anyone implement a database table that has 
two columns that always would be the same?  Won't just one coulmn be enough? 
  Maybe I am missing something.

While this is not always true, most of the time your foriegn key references 
refer to the parent table's primary key.

I think that your data model needs a bit of review.


----- Original Message -----
From: "Kelvin Tan" <[EMAIL PROTECTED]>
To: "Turbine Users List" <[EMAIL PROTECTED]>
Sent: Saturday, November 17, 2001 6:33 AM
Subject: [torque] Bug in OM Generation


>Think I've found one...
>
>In the schema file, I'm mapping one local reference key as a foreign key
>twice (I don't even know if I'm supposed to. I'm just trying it out)
>
><column name="foo" ...>
>
><foreign-key foreignTable="barTable">
>   <reference local="foo" foreign="bar">
></foreign-key>
><foreign-key foreignTable="barTable">
>   <reference local="foo" foreign="bar2">
></foreign-key>
>
>Running ant builds fine. SQL is generated and OM is generated. However when
>I attempt to compile, the compiler complains. Specifically, with only
>foreign-key of bar, and only foreign-key of bar2, everything is ok. But 
>when
>I add both bar and bar2 as foreign keys, the BaseBar2 object doesn't
>compile.
>
>Examining the code, the problem <b>seems</b> to be in the setId(StringKey 
>v)
>method, a snippet from the actual code:
>
>               // update associated AclEntry
>               if (collAclEntrys != null )
>               {
>                   for (int i=0; i<collAclEntrys.size(); i++)
>                   {
>                       ((AclEntry)collAclEntrys.get(i))
>                           .set${colFK.JavaName}(v);
>                   }
>               }
>
>The offender is where Velocity was supposed to fill in the value for
>$colFK.JavaName but didn't.
>
>I'd write a test-case, but the darned test-cases don't even pass when
>everything is working (Win9x)...Will help with anything else though.
>
>Regards,
>Kelvin
>
>
>
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: 
><mailto:[EMAIL PROTECTED]>
>
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to