On Fri, 15 Sep 2000 08:35:57 +0200, Turbine wrote:

>  > > In newtorque foreign keys are only allowed to be one column, but it
can
>  > > reference
>  > > a different column in the foreign table.  That is FOREIGN KEY (A)
>  references
>  > > TABLE2 (B).  This is about as far as the flexibility goes at the
moment.
>  > >
>  > > Maybe you can think of a nice way of representing this in the xml
schema
>  file.
>  > > We'll also need to be able to add this to MapBuilder so that Peers
are
>  aware
>  > > of
>  > > multi-column foreign keys.
>  > >
>  > > BTW I'm almost finished with your patches along with some other stuff
>  and I
>  > > will
>  > > upload it tomorrow morning...
>  > >
>  > > ~ Leon
>  >
>  > Uh. I believe this used to work just fine. Why are we loosing features?
>  
>  How would one go about defining this in ColumnMaps?
>  
>  FOREIGN KEY (A,B) REFERENCES tbl (X,Y)
>  
>  I can see that it could be come
>  
>  tMap.addForeignKey ( 'A' , integer , "tbl" , "X" );
>  tMap.addForeignKey ( 'B' , integer , "tbl" , "Y" );
>  
>  My point is that you loose the fact that it is a combined foreign key. 
If
>  this isn't important for Peers to know (I don't suppose so) then we can
just
>  create map builders like this.  If the combination is important however
>  we'll need to think of something else....

Combination IS important so the code should look something like:

tMap.addForeignKey(
                  new ForeignKey(this,bl.getKey("PK_TBL")) 
                         .addColumn(tMap.getColumn("A"))
                         .addColumn(tMap.getColumn("B"))
                  )

getKey should return Primary or unique key by name. This is because of the
fact that foreign key references not an arbitrary set of columns but a
unique or pri key (btw I did not reflect it in the XML i wrote before. that
one needs to be changed).

It looks like we need to treat pri/uni keys as entities as well....


Opinions?

fedor.





_______________________________________________________
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to