[OS-JIRA] Created: (CAY-467) Prefetched Query Refresh Bug for refreshing entities of query table only one time

From: jira-norepl..bjectstyle.org
Date: Mon Feb 27 2006 - 02:52:17 EST

  • Next message: Kevin Menard: "JPA Stuff"

    Message:

      A new issue has been created in JIRA.

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

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

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-467
        Summary: Prefetched Query Refresh Bug for refreshing entities of query table only one time
           Type: Bug

         Status: Unassigned
       Priority: Major

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Versions:
                 1.2 [DEV]

       Assignee:
       Reporter: emre

        Created: Mon, 27 Feb 2006 2:52 AM
        Updated: Mon, 27 Feb 2006 2:52 AM
    Environment: Windows XP, hp compaq nc6120, 1 GB DDR Ram, 40 GB HDD,cayenne-1.2-dev-2006-2-23,Ms Sql 7.0

    Description:
    PersonelCard = Object Entity;
    badgeNo = attribute of PersonelCard;
    PersonelRel = Relationship of PersonelCard to Personel
    Personel = Object Entity;
    firstName = attribute of Personel;

    Prefetched objects of PersonelCard's relational tables(like PersonelRel) refreshed correctly but attiributes (like badgeNo) of PersonelCard table refreshed only first update.

    For example: if you change the firstName "ex1",then "ex2" then "ex3" then "ex4" console prints for firstName:
    ex1
    ex2
    ex3
    ex4 This is correct.(PersonelRel.firstName)

    But when I update the badgeNo like "ex1",then "ex2" then "ex3" then "ex4" console prints for badgeNo:
    ex1
    ex2
    ex2
    ex2 This is not correct.(PersonelCard.badgeNo)

    public static void main(String[]arg){
    DbObject.setContext();
    List list = getLists();
    Iterator itr = list.iterator();
    while(itr.hasNext()){
    PersonelCard card = (PersonelCard)itr.next();
    System.err.println("getBadgeNo "+card.getBadgeNo());
    System.err.println("getFirstName "+card.getPersonelRel().getFirstName());
    }
    }
    }

    public static List getLists() {

    SelectQuery query = new SelectQuery(PersonelCard.class);
    query.setRefreshingObjects(true);
    Expression qualifier = ExpressionFactory.matchExp(ASSIGNED_PROPERTY, new
    Boolean(true));
    query.setQualifier(qualifier);
    qualifier = ExpressionFactory.noMatchExp(BADGE_NO_PROPERTY, null);
    query.andQualifier(qualifier);
    qualifier = ExpressionFactory.noMatchExp(BADGE_NO_PROPERTY, new Integer(0));
    query.andQualifier(qualifier);
    qualifier = ExpressionFactory.noMatchExp(TRANSPONDER_NO_PROPERTY, null);
    query.andQualifier(qualifier);
    qualifier = ExpressionFactory.noMatchExp(PERSONEL_REL_PROPERTY, null);
    query.andQualifier(qualifier);
    qualifier = ExpressionFactory.matchExp("personelRel.deleted", new Boolean
    (false));
    query.andQualifier(qualifier);

    query.setCachePolicy(QueryMetadata.LOCAL_CACHE_REFRESH);
    query.addPrefetch("personelRel").setSemantics(
    PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);
    query.addPrefetch("cardValidtyRel").setSemantics(
    PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);
    return context.performQuery(query);
    }

    ---------------------------------------------------------------------
    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 Feb 27 2006 - 02:52:18 EST