Re: Can't add an element. Why?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri May 21 2004 - 19:57:35 EDT

  • Next message: Eric Schneider: "SQLTemplate doing something differently?"

    On May 21, 2004, at 2:27 PM, Mike Elliott wrote:
    > <db-entity name="join_artist_exhibit">
    > <db-attribute name="artist_pk" type="INTEGER" isMandatory="true"/>
    > <db-attribute name="exhibit_pk" type="INTEGER" isMandatory="true"/>
    > <db-attribute name="pk" type="INTEGER" isPrimaryKey="true"
    > isMandatory="true"/>
    > </db-entity>

    > Are all flattened relationships read-only?

    No, not all. However currently Cayenne checks that all attributes of
    the join table are a part of the primary key. In your case it really
    doesn't matter, and I think this check is dumb. For now to fix it, mark
    artist_pk and exhibit_pk columns as PK in the modeler. I opened a bug
    report (http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-130),
    so this should be fixed in Cayenne soon.

    > If the relationship is read-only, why is a method generated solely
    > for the modification of it which, whenever it is run, merely throws an
    > exception saying
    > it can't do anything?

    There is an old task that is supposed to address this issue:
    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-38 . So it
    won't be like that in the future.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri May 21 2004 - 19:57:41 EDT