Re: Relationship between tables

From: Sami Mohammed (SMOHAMME..ndependenthealth.com)
Date: Mon Mar 14 2005 - 13:40:30 EST

  • Next message: Mike Kienenberger: "Re: Storing a copy of a DataObject in the session"

    Andrus,

    Thank you

    Sami

    CONFIDENTIALITY NOTICE. This e-mail and attachments, if any, may contain confidential information which is privileged and protected from disclosure by Federal and State
    confidentiality laws rules and regulations. This e-mail and attachments, if any, are intended for the designated addressee only. If you are not the designated addressee, you
    are hereby notified that any disclosure, copying, or distribution of this e-mail and its attachments, if any, may be unlawful and may subject you to legal consequences. If you
    have received this e-mail and attachments in error, please contact Independent Health immediately at (716) 631-3001 and delete the e-mail and its attachments from your
    computer. Thank you for your attention

    >>> andru..bjectstyle.org 03/12/05 12:19AM >>>
    Sami,

     From the first glance this looks ok to me... One thing I noticed is
    that a relationship from employee to department is missing. Did you
    delete it manually? I suggest you add it back. In XML it will look like
    this:

    <obj-relationship name="toDept" source="Emp" target="Dept"
    deleteRule="Nullify" db-relationship-path="toDept"/>

    Cheers,
    Andrus

    On Mar 11, 2005, at 4:14 PM, Sami Mohammed wrote:

    > Hi
    >
    > I have 2 tabel emp and dept(Master).
    > emp has foregin key (deptno).
    >
    > see tables below
    >
    > Dept Table :
    > -------------------------------
    > deptno number primary key
    > dname varchar2
    > loc varchar2
    > --------------------------------
    >
    >
    > emp table:
    > ------------------------------
    > empno number primary key
    > ename varchar,
    > salary number,
    > job varchar,
    > deptNo --> Foreign key reffering to dept tabel.
    > ------------------------------------------------------
    > when i renginering cayenne developed the follwing code. is this
    > correct or i have to do manually for the reletionship in the cayenne
    > modeler.
    > pls let me know.
    >
    > <db-entity name="EMP" schema="MySchema">
    > <db-attribute name="DEPTNO" type="INTEGER" length="22"/>
    > <db-attribute name="EMPNO" type="INTEGER" isPrimaryKey="true"
    > isMandatory="true" length="22"/>
    > <db-attribute name="ENAME" type="VARCHAR" length="50"/>
    > <db-attribute name="JOB" type="VARCHAR" length="50"/>
    > <db-attribute name="SALARY" type="INTEGER" length="22"/>
    > </db-entity>
    >
    >
    > <db-entity name="DEPT" schema="MySchema">
    > <db-attribute name="DEPTNO" type="INTEGER" isPrimaryKey="true"
    > isMandatory="true" length="22"/>
    > <db-attribute name="DNAME" type="VARCHAR" length="50"/>
    > <db-attribute name="LOC" type="VARCHAR" length="50"/>
    > </db-entity>
    >
    >
    > <db-relationship name="empArray" source="DEPT" target="EMP"
    > toMany="true">
    > <db-attribute-pair source="DEPTNO" target="DEPTNO"/>
    > </db-relationship>
    > <db-relationship name="toDept" source="EMP" target="DEPT"
    > toMany="false">
    > <db-attribute-pair source="DEPTNO" target="DEPTNO"/>
    > </db-relationship>
    > <obj-relationship name="empArray" source="Dept" target="Emp"
    > deleteRule="Cascade" db-relationship-path="empArray"/>



    This archive was generated by hypermail 2.0.0 : Mon Mar 14 2005 - 13:41:01 EST