Re: set method fails on relationship

From: Andrus (andru..bjectstyle.org)
Date: Tue Aug 20 2002 - 00:00:14 EDT

  • Next message: Andrus: "RE: takeValuesFromDictionary: equvalent"

    At 12:40 AM 8/19/2002 -0500, you wrote:
    >Address address = new Address();
    > address.setCity("Austin");
    > address.setState("TX");
    > address.setStreetAddress1("2000 Research Blvd");
    > address.setZip("78759");
    > ctxt.registerNewObject(address, "Address");

    The problem is that relationship is being set before the object is
    registered with DataContext. While we should probably add a check for that
    in "setReverseRelationship" method that throws the exception, I would
    suggest creating address the following way in the first line of code:

    Address address = (Address)ctxt.createAndRegisterNewObject("Address");

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Aug 20 2002 - 00:00:13 EDT