[OS-JIRA] Created: (CAY-88) Unable to see why my flattened toMany is read-only

From: jir..bjectstyle.org
Date: Thu Jan 29 2004 - 20:18:06 EST

  • Next message: jir..bjectstyle.org: "[OS-JIRA] Created: (CAY-89) NOT LIKE IGNORE CASE generates broken SQL"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-88

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-88
        Summary: Unable to see why my flattened toMany is read-only
           Type: Bug

         Status: Assigned
       Priority: Major

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Versions:
                 1.0 [STABLE]

       Assignee: Andrus Adamchik
       Reporter: Scott Ellsworth

        Created: Thu, 29 Jan 2004 8:16 PM
        Updated: Thu, 29 Jan 2004 8:16 PM
    Environment: MacOS X/Cayenne 1.0.6

    Description:
    Duplicate of email message, supplied as an issue so I can attach the map.

    I have a PlayerDBEntity, a SystemDbEntity, and a PlayerSystemLinkDbEntity, with toMany relationships going from the Link to the Player and System.

    I have a PlayerObjEntity and a SystemObjEntity. They each have toMany relationships that use flattening, such as linkPlayers.players.

    When I tried to add a Player to a System using

    StarSystem system = systems[i];
    system.addToPlayers(players[thisPlayer++]);

    I got the error

    Exception in thread "main" org.objectstyle.cayenne.CayenneRuntimeException: [v.1.0.6 January 26 2004] Cannot modify (add to) the read-only relationship players
            at org.objectstyle.cayenne.CayenneDataObject.addToManyTarget(CayenneDataObject.java:298)
            at com.alodar.starmap.persist.StarSystem.addToPlayers(StarSystem.java:81)
            at com.alodar.starmap.DatabasePopulator.addPlayersToSytem(DatabasePopulator.java:176)
            at com.alodar.starmap.DatabasePopulator.populateByNumber(DatabasePopulator.java:76)
            at com.alodar.starmap.DatabasePopulator.main(DatabasePopulator.java:42)

    The systems and the players are recently created, so this is not a prefetch issue like my previous ones.

    I note in the docs that many-many is supposed to work, so I suspect that something about my data model makes it not fit the many-many requirement. If it would help, I will send the data model about, as it is only 2k zipped.

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Thu Jan 29 2004 - 20:18:08 EST