Hi Werner,
    This can help me. If I want to just put a foreign key in a one table.  Can I make the bidirection relation?
 
Thanks
Ken 

Werner Guttmann <[EMAIL PROTECTED]> 写道:
Hi,

there's absolutely no need to make a foreign key part of a primary key per definition. All you are going to need are foreign key columns on USER and USER_INFO that point to the related objects. In other words, your table layout could be similar to

[USER]
USR_ID (PRIMARY KEY)
USR_NAME
USR_INFO_ID (FOREIGN KEY)

[USER_INFO]
USR_INFO_ID (PRIMARY KEY)
USR_ID (FOREIGN KEY)
FIRST_NAME

I hope this helps.

Regards
Werner


________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Donnerstag, 23. M盲rz 2006 17:18
To: castor
Subject: [castor-user] How to do relation 1:1 bidirection


I've table USER and USER_INFO, their relation is 1:1. I want to make it to bidirection, how can I do it?

[USER]
USR_ID
USR_NAME

[USER_INFO]
USR_ID (USER.FK) --if foreign key as the primary key is not support in castor can add another primary key USER_INFO_ID.
FIRST_NAME

________________________________

������瀹归����������稿��锛������剧��澶т��杞斤��瓒�蹇����搴�锛�璧跺揩��㈡敞锛�



雅虎1G免费邮箱百分百防垃圾信
雅虎助手-搜索、杀毒、防骚扰


雅虎1G免费邮箱百分百防垃圾信

Reply via email to