Re: PK Column - Cayenne Modeler

From: Michael Gentry (blacknex..mail.com)
Date: Sat Jul 22 2006 - 11:07:42 EDT

  • Next message: Rashid Khan: "Re: PK Column - Cayenne Modeler"

    For Report, you want report_id set as PK (I think this automatically
    checks Mandatory, too, since a PK must be mandatory). For Schedule,
    you want schedule_id set as PK. You don't mark FKs as a PK, but if
    the Report must belong to a Schedule, I'd mark Report's schedule_id as
    mandatory. If this is the case, you may also want to set up a cascade
    delete rule from Schedule -> Report to automatically delete all
    Reports when you delete a Schedule. (The delete rule for
    Report->Schedule would be no action.)

    /dev/mrg

    On 7/22/06, Rashid Khan <rashidk..mail.com> wrote:
    > Hi,
    >
    > I am using cayenne-1.2RC1. I want to know in what kind of situation
    > the PK column in the modeler has to be checked.
    >
    > Let's say I have the following setup.
    >
    > 1. Report Table with columns: report_id, report_name, schedule_id.
    > (where schedule_id is a foreign key)
    >
    > 2. Schedule Table with columns: schedule_id, schedule_desc.
    >
    > Report >- Schedule (Many-to-one relationship)
    >
    > The modeler automatically checks the PK column for report_id. I am
    > confused whether to make the PK checked for schedule_id as well in
    > report db entity.
    >
    > I hope my question is clear.
    >
    > Thanks,
    >
    > Rashid Khan
    >



    This archive was generated by hypermail 2.0.0 : Sat Jul 22 2006 - 11:08:06 EDT