Re: Remove Foreign Keys Mapped as Object Attributes

From: Mike Kienenberger (mkienen..mail.com)
Date: Wed Jun 06 2007 - 17:14:39 EDT

  • Next message: Robert Zeigler: "Re: Cayenne web application tutorial"

    Yes, you generally want to do this.

    It means that you are going to let Cayenne manage the foreign and
    primary keys for the entities involved. Then, instead of having to
    deal with

    table2.setFk2pk1Field(Table1.somehowGetPrimaryKeyWhichMightNotBeComputedYet())

    all you need to do is

    table2.setFk2pk1Relationship(table1);

    On 6/6/07, Fredrik Liden <flide..ranslate.com> wrote:
    > When I synch the dbentity with the object I get the following prompt:
    >
    > "Remove foreign keys mapped as Object Attributes."
    >
    > Could someone explain what this one does? What are the pros and cons of
    > removing the foreign keys?
    >
    > This is a 1-many relationship.
    >
    > Table 1
    > Pk1
    > Field1
    >
    > Table 2
    > Pk2
    > Field2
    > Fk2_pk1
    >
    > Thanks,
    >
    > Fredrik
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Jun 06 2007 - 17:15:05 EDT