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

From: Cris Daniluk (cris.danilu..mail.com)
Date: Mon Feb 06 2006 - 19:10:06 EST

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

    Oops. I guess the fact that setName is deprecated now answers that question :)

    On 2/6/06, Cris Daniluk <cris.danilu..mail.com> wrote:
    > This is because NamedQuery introduces a queryName field which seems to
    > be redundant to IndirectQuery.name.
    >
    > Is there a reason why they're both? I made a simple patch that takes
    > out queryName, and instead uses IndirectQuery.name, but I didn't know
    > if queryName was what we were moving to. In that case, it would
    > probably be better to just dual-set queryName to name in the
    > constructor.
    >
    > On 2/6/06, jira-norepl..bjectstyle.org <jira-noreply@objectstyle.org> wrote:
    > > 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 - 19:10:08 EST