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

  • werner_guttmann / 200 / Wed, 24 Jun 2009 20:06:00 GMT / 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:

    put, foreign, key, table, bidirection, relation, java, source, software

  • http://java.itags.org/java-open-source/200905/«« Last Thread - Next Thread »»
  • Java Open Source Software Questions

    • Making Jasper Reports works.

      I am new to Jasper reports. I copy a sample code on how to use jasper reports using Netbeans 5.5. Fo...

      By shalimarlagcao, 1 Comments

    • Making group layouts persistent...

      Hi ,We have a gridsphere 2.0.4 installation and a set of custom portlets deployedas a separate group...

      By rajesh_kalyanam, 1 Comments

    • Performance Issues with Logging

      Logging open sources like log4j and Logger( as implemente dy sun) has various levels of logging (deb...

      By vaitheesub, 1 Comments

    • free chat application

      can someone suggest me a free ajax chat application which works with java....

      By dilshanedirisuriya, 3 Comments

    • Java Issue Tracking Software

      Hi, can any body tell free (java- version) project management and issue tracking software. Its urgen...

      By lakshmanakumarloganathan, 1 Comments