EO model validation, relations and foreign keys

From: Zak Burke (zdbw..artmouth.EDU)
Date: Thu Aug 17 2006 - 10:25:12 EDT

  • Next message: Chuck Hill: "Re: EO model validation, relations and foreign keys"

    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.



    This archive was generated by hypermail 2.0.0 : Thu Aug 17 2006 - 10:25:19 EDT