Home » Category » Java Open Source Software

Java Open Source Software: If I want to just put a foreign key in a one table. Can I make the bidirection relation

200| Wed, 07 May 2008 12:17:00 GMT| werner_guttmann| Comments (0)
Not really ... ;-(. But before committing myself to this reply, why not show us what table layout you have in mind ?

Werner

kendeng9898-castor...yahoo.com.cn wrote:
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
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: kendeng9898-castor...yahoo.com.cn
[mailto:kendeng9898-castor...yahoo.com.cn]
Sent: Donnerstag, 23. Mrz 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

If you wish to unsubscribe from this list, please
send an empty message to the following address:

user-unsubscribe...castor.codehaus.org
---

Keywords & Tags: put, foreign, key, table, bidirection, relation, java, source, software

URL: http://java.itags.org/java-open-source/200905/
 
«« Prev - Next »» 0 helpful answers below.

Java Open Source Software Hot Answers

Java Open Source Software New questions

Java Open Source Software Related Categories