Re: Why is a refetchObject required

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Mar 23 2004 - 00:05:42 EST

  • Next message: Todd Blanchard: "Creating initial postgres model"

    On Mar 22, 2004, at 9:47 PM, Steve Wells wrote:
    > When I have loaded an Org and call its getToState(), i get a row but
    > the
    > State returned is hollow (this is done from JSP/struts).

    > I then created a method of Org called getStateName(), same thing:
    > State state = this.getToState();
    > return state.getName(); // returns null

    There is nothing wrong with an object returned in HOLLOW state from
    relationship (in fact this is expected), however if after calling
    "getName()" an object still remains HOLLOW, this is strange... Could
    you doublecheck that "getName()" is a generated method that looks like
    that:

    public String getName() {
        return (String)readProperty("name");
    }

    and is not overwritten in the subclass?

    > Also do we need to define the reverse relationsip in 1.1 M4 ?

    There have been no change since 1.0 as far as relationships. You do
    have to have two-way DbRelationships. Also if you have a to-many
    ObjRelationship, some things may not work without a reverse to-one.
    However relationships were made more "lazy" - i.e. if you add set an
    Artist of a Painting, this will not trigger a fetch of all other
    Paintings for this Artist. Also in the nearest future I am planning to
    improve the Modeler UI to make handling of reverse DB relationships
    more transparent.

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Mar 23 2004 - 00:05:46 EST