[OS-JIRA] Created: (CAY-441) unnamed query error on named query

From: jira-norepl..bjectstyle.org
Date: Mon Feb 06 2006 - 18:51:37 EST

  • Next message: Cris Daniluk: "Re: [OS-JIRA] Created: (CAY-441) unnamed query error on named query"

    Message:

      A new issue has been created in JIRA.

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

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

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-441
        Summary: unnamed query error on named query
           Type: Bug

         Status: Assigned
       Priority: Minor

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

       Assignee: Andrus Adamchik
       Reporter: Cris Daniluk

        Created: Mon, 6 Feb 2006 6:51 PM
        Updated: Mon, 6 Feb 2006 6:51 PM

    Description:
    After updating CVS, I'm receiving an exception while executing a named query, retrieved as such:

            DataContext context = DataContext.createDataContext();
            DataMap map = ((DataMap) context.getEntityResolver().getDataMaps().iterator().next());
            
            Iterator queryIter = map.getQueries().iterator();
            
            while (queryIter.hasNext()) {
                Query query = (Query) queryIter.next();
                
                if (query.getName().startsWith("Cache")) {
                    context.performQuery(query.getName(), true);
                }
                
            }

    Basically, I'm trying to avoid lazy loading on certain named cached queries. However, I'm getting an error about it being an unnamed query:

    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.2-dev February 6 2006] Caching of unnamed queries is not supported. Query: NamedQuery:null
            at org.objectstyle.cayenne.access.DataDomainQueryAction.interceptSharedCache(DataDomainQueryAction.java:238)
            at org.objectstyle.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:137)
            at org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:724)
            at org.objectstyle.cayenne.access.Transaction.onQuery(Transaction.java:206)
            at org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:721)
            at org.objectstyle.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:244)
            at org.objectstyle.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:89)
            at org.objectstyle.cayenne.access.DataContext.onQuery(DataContext.java:1261)
            at org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1250)
            at org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1444)
            at org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1425)
            at
    ...

    ---------------------------------------------------------------------
    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 06 2006 - 18:51:38 EST