Queries

From: Ted Moens (tmoen..elus.net)
Date: Mon Mar 03 2008 - 13:46:59 EST

  • Next message: Eric Polino: "Expression string"

    Greetings:

    I am trying to do a parameterized select query. My situation is
    directly analogous to the example:

    list.add(ExpressionFactory.matchExp("paintingTitle",
              new ExpressionParameter("pname")));
    list.add(ExpressionFactory.matchExp("toArtist.artistName",
              new ExpressionParameter("aname")));

    I follow this pattern but I run into troubles with when the first
    argument to the matchExp is an attribute of an object other than the
    target class itself. So in the above example, the first expression
    works fine but the second would fail with the following:

    Can't resolve path component: [Artist.artistName])

    I've very carefully checked that in other situations the attribute
    analogous to Artist.artistName is in fact accessible.

    Is there a common error made in these situations?

    Thanks in advance for any help.

    Ted

    FYI...

            at org.apache.cayenne.map.Entity$PathIterator.next(Entity.java:375)
            at
    org.apache.cayenne.access.trans.QueryAssemblerHelper.appendObjPath(QueryAssemblerHelper.java:90)
            at
    org.apache.cayenne.access.trans.QualifierTranslator.objectNode(QualifierTranslator.java:338)
            at org.apache.cayenne.exp.Expression.traverse(Expression.java:455)
            at org.apache.cayenne.exp.Expression.traverse(Expression.java:452)
            at org.apache.cayenne.exp.Expression.traverse(Expression.java:432)
            at
    org.apache.cayenne.access.trans.QualifierTranslator.doTranslation(QualifierTranslator.java:74)
            at
    org.apache.cayenne.access.trans.SelectTranslator.createSqlString(SelectTranslator.java:123)
            at
    org.apache.cayenne.dba.mysql.MySQLSelectTranslator.createSqlString(MySQLSelectTranslator.java:31)
            at
    org.apache.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:95)
            at
    org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:71)
            at
    org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:57)
            at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:236)
            at
    org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:446)
            at
    org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:67)
            at
    org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:418)
            at
    org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:853)
            at
    org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:415)
            at
    org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:119)
            at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:746)
            at
    org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:282)
            at
    org.apache.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:59)
            at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:1323)
            at
    org.apache.cayenne.access.DataContext.performQuery(DataContext.java:1312)
            at org.tsw.ultiserver.getXMLData.processRequest(getXMLData.java:138)
            at org.tsw.ultiserver.getXMLData.doGet(getXMLData.java:159)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
            at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
            at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
            at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
            at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
            at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
            at
    org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
            at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
            at java.lang.Thread.run(Unknown Source)



    This archive was generated by hypermail 2.0.0 : Mon Mar 03 2008 - 13:49:17 EST