Re: New objects break FK constraints

From: Jim Menard (jim..o.com)
Date: Fri Jan 30 2004 - 08:21:55 EST

  • Next message: Andriy Shapochka: "Re: New objects break FK constraints"

    On Jan 30, 2004, at 1:18 AM, Andriy Shapochka wrote:

    > At present we do not handle circular relationships in a
    > constraint-proof manner.

    I understand. Thanks for your explanation.

    Andrus wrote,

    > Now that I have a DataMap to look at, I se what is happening. Entities
    > have a circular dependency: Address depends on Member, Member depends
    > on BillAccount, BillAccount depends on Address:
    >
    > Address -> Member -> BillAccount -> Address

    I realized, however, that the *intention* of my schema is not circular.
    Yes, Address has a member_id field. It is nullable, however. Only some
    addresses have member pointers.

    Also, the tables may appear circular, but the objects themselves are
    clearly not. I have

            BillAccount -> Address1
            Address2 -> Member
            Member -> BillAccount

    This can be resolved by writing Address1, then BillAccount, then
    Member, then Address2. (Actually, you could write Address2 first
    because there should be no constraint on the FK to Member; the FK can
    be null.)

    Can the order of insertion be done by analyzing the objects themselves
    instead of the table schemas?

    Jim

    -- 
    Jim Menard, jim..o.com, http://www.io.com/~jimm/
    "If at first you don't succeed, don't go skydiving." -- Unknown
    



    This archive was generated by hypermail 2.0.0 : Fri Jan 30 2004 - 08:22:01 EST