[OS-JIRA] Created: (CAY-285) Straight Prefetch on flattened gives ClassCastException

From: jira-norepl..bjectstyle.org
Date: Mon Mar 07 2005 - 00:28:18 EST

  • Next message: Andrus Adamchik: "Joint Prefetches"

    Message:

      A new issue has been created in JIRA.

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

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

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-285
        Summary: Straight Prefetch on flattened gives ClassCastException
           Type: Bug

         Status: Assigned
       Priority: Major

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Fix Fors:
                 1.2 [DEV]
       Versions:
                 1.1
                 1.2 [DEV]

       Assignee: Andrus Adamchik
       Reporter: Andrus Adamchik

        Created: Mon, 7 Mar 2005 12:27 AM
        Updated: Mon, 7 Mar 2005 12:27 AM

    Description:
    Copied from CAY-15 (as main CAY-15 problem was resolved differently). The error: http://objectstyle.org/cayenne/lists/cayenne-user/2004/11/0151.html

    Test case (insert in FlattenedPrefetchTst):

       public void testManyToMany() throws Exception {
            createTestData("testPrefetch1");

            SelectQuery q = new SelectQuery(Artist.class);
            q.addPrefetch(Artist.GROUP_ARRAY_PROPERTY);

            DataContext context = createDataContext();

            List objects = context.performQuery(q);
            assertEquals(3, objects.size());

            Iterator it = objects.iterator();
            while (it.hasNext()) {
                Artist a = (Artist) it.next();
                ToManyList list = (ToManyList) a.getGroupArray();

                assertNotNull(list);
                assertFalse("artist's groups not resolved: " + a, list.needsFetch());
                assertTrue(list.size() > 0);

                Iterator children = list.iterator();
                while (children.hasNext()) {
                    ArtGroup g = (ArtGroup) children.next();
                    assertEquals(PersistenceState.COMMITTED, g.getPersistenceState());
                }
            }
        }

    ---------------------------------------------------------------------
    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 : Mon Mar 07 2005 - 00:28:20 EST