Re: Error resolving fault for ObjectId

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Oct 06 2006 - 14:24:28 EDT

  • Next message: Arturo Pérez: "object with toMany.size() == 0?"

    Dima,

    looks like "customerMembership" relationship should be to-many.

    Andrus

    > <db-relationship name="customerMembership" source="tbl_customer"
    > target="tbl_membership" toDependentPK="true" toMany="false">
    > <db-attribute-pair source="CUSTOMER_ID" target="customer_id"/>
    > </db-relationship>
    > <db-relationship name="membershipCustomer"
    > source="tbl_membership" target="tbl_customer" toMany="false">
    > <db-attribute-pair source="customer_id" target="CUSTOMER_ID"/>
    > </db-relationship>

    On Oct 5, 2006, at 5:59 AM, Dima Gritsenko wrote:

    > Hi, Sorry for messing up a thread, but had a glitch with
    > subscription, thus renewing the tread again for the subject. To:
    > Mike KienenbergerYes, Mike the record as there in the DB. Any other
    > suggestions?Thank you. Dima.
    > ---------------------------------------------------------------Did
    > you verify that [Membership, customer_id=116080] exists in the
    > database at this moment in time?
    >
    > On 9/16/06, Dima Gritsenko <dim..kreative.com> wrote:
    >> Hi,
    >>
    >> We are having the following problem (mapping provided below):
    >>
    >> Access to the property "joinDate" of the Memebership object using
    >> jstl
    >> <fmt:formatDate value="$
    >> {custEmail.emailCustomer.customerMembership.joinDate}"
    > type="both"/>
    >>
    >> Causes this exception:
    >> 2006-09-04 10:15:56 ApplicationDispatcher[/csr] Servlet.service()
    >> for servlet jsp threw
    > exception
    >> org.objectstyle.cayenne.FaultFailureException: [v.1.2 July 16
    >> 2006] Error resolving fault
    > for ObjectId: <ObjectId:Membership, customer_id=116080> and state
    > (hollow). Possible
    > cause - matching row is missing from the database.
    >> at org.objectstyle.cayenne.access.DataContext.prepareForAccess
    >> (DataContext.java:1851)
    >> at org.objectstyle.cayenne.CayenneDataObject.readProperty
    >> (CayenneDataObject.java:238)
    >> at persistence.auto._Membership.getJoinDate(_Membership.java:59)

    [..]

    >>
    >> This is similar to the problem described here: http://
    >> www.objectstyle.org/cayenne/lists/cayenne-user/2006/06/0147.html
    >> but ours is different since both customer_id fields are PKs.
    >>
    >> Mapping
    >> <db-entity name="tbl_membership" catalog="main">
    >> <db-attribute name="customer_id" type="INTEGER"
    >> isPrimaryKey="true" isMandatory="true"
    > length="10"/>
    >> <db-attribute name="order_id" type="INTEGER"
    >> isPrimaryKey="true" isMandatory="true"
    > length="10"/>
    >> <db-attribute name="join_date" type="TIMESTAMP" length="19"/>
    >> <db-attribute name="last_renewal_date" type="TIMESTAMP"
    >> length="19"/>
    >> <db-attribute name="membership_type" type="CHAR"
    >> length="50"/>
    >> <db-attribute name="cancellation_date" type="TIMESTAMP"
    >> length="19"/>
    >> <db-attribute name="cancellation_reason" type="CHAR"
    >> length="255"/>
    >> <db-attribute name="expiration_date" type="TIMESTAMP"
    >> length="19"/>
    >> <db-attribute name="cancellation_number" type="CHAR"
    >> length="50"/>
    >> </db-entity>
    >>
    >> <db-entity name="tbl_customer" catalog="main">
    >> <db-attribute name="CUSTOMER_ID" type="INTEGER"
    >> isPrimaryKey="true" isMandatory="true"
    > isGenerated="true" length="10"/>
    >> <db-attribute name="BRAND_ID" type="INTEGER" length="10"/>
    >> <db-attribute name="FIRST_NAME" type="VARCHAR" length="50"/>
    >> <db-attribute name="MIDDLE_NAME" type="VARCHAR" length="50"/>
    >> <db-attribute name="LAST_NAME" type="VARCHAR" length="50"/>
    >> <db-attribute name="LOGIN_NAME" type="VARCHAR" length="50"/>
    >> <db-attribute name="LOGIN_PASSWORD" type="VARCHAR"
    >> length="50"/>
    >> <db-attribute name="SESSIONS_COUNT" type="INTEGER"
    >> length="10"/>
    >> </db-entity>
    >>
    >> <db-relationship name="customerMembership"
    >> source="tbl_customer" target="tbl_membership"
    > toDependentPK="true" toMany="false">
    >> <db-attribute-pair source="CUSTOMER_ID"
    >> target="customer_id"/>
    >> </db-relationship>
    >> <db-relationship name="membershipCustomer"
    >> source="tbl_membership" target="tbl_customer"
    > toMany="false">
    >> <db-attribute-pair source="customer_id"
    >> target="CUSTOMER_ID"/>
    >> </db-relationship>
    >>
    >>
    >> Thank you.
    >> Dima.



    This archive was generated by hypermail 2.0.0 : Fri Oct 06 2006 - 14:24:36 EDT