Re: EO model validation, relations and foreign keys

From: Chuck Hill (chil..lobal-village.net)
Date: Thu Aug 17 2006 - 13:42:05 EDT

  • Next message: Ken Anderson: "Re: Patch for tripleclick / doubleclick'n drag in Eclipse 3.2.0 for MacOSX"

    It sounds more like the relationship is not defined correctly. Are
    you propagating the primary key (or should you be)? Is the PK of
    some time that EOF can't generate?

    Chuck

    On Aug 17, 2006, at 7:25 AM, Zak Burke wrote:

    > I posted this note to the webobjects-dev list a few days ago but
    > didn't
    > get any bites, so maybe it's a woproject issue, or maybe it's my own
    > code that is causing these issues. At any rate...
    >
    > When I validate a model using the woproject Entity Modeler, it
    > complains
    > if a class has a relationship with the Optionality marked as
    > "Mandatory"
    > but the join-field marked as optional. If I make both the relationship
    > and the foreign-key required, however, EOF complains in
    > EOEditingContext.saveChanges() that the foreign key can't be null:
    >
    > Validation failed on an object [org.thei3p.eo.DLOrganization]
    > with keypath = entityId and exception: The entityId property of
    > DLOrganization is not allowed to be null.
    >
    > It seems to me that the Entity Modeler gets the constraints right but
    > that EOF is doing validation before it generates keys for the DB
    > tables.
    >
    > Is there any way to force EOF to generate its EO keys before checking
    > the validity of the EOs to be persisted?
    >
    > Thanks,
    >
    > zak.

    -- 
    

    Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects



    This archive was generated by hypermail 2.0.0 : Thu Aug 17 2006 - 13:42:18 EDT