cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] Created: (CAY-1361) SelectQuery.aliasPathSplits does nothing
Date Sun, 10 Jan 2010 12:16:54 GMT
SelectQuery.aliasPathSplits does nothing
----------------------------------------

                 Key: CAY-1361
                 URL: https://issues.apache.org/jira/browse/CAY-1361
             Project: Cayenne
          Issue Type: Bug
          Components: Core Library
    Affects Versions: 3.0RC1
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
             Fix For: 3.0RC2


SelectQuery.aliasPathSplits doesn't actually add the split expressions, so a test like this
generates an exception:

        SelectQuery query = new SelectQuery(Artist.class);
        query.andQualifier(ExpressionFactory.matchExp("p.paintingTitle", "X"));
        query.aliasPathSplits("paintingArray", "p");
        context.performQuery(query);

INFO: *** error.
org.apache.cayenne.exp.ExpressionException: [v.3.1-SNAPSHOT ${project.build.date} ${project.build.time}]
Can't resolve path component: [Artist.p].
	at org.apache.cayenne.map.PathComponentIterator.invalidPathException(PathComponentIterator.java:145)
	at org.apache.cayenne.map.PathComponentIterator.next(PathComponentIterator.java:133)
	at org.apache.cayenne.map.PathComponentIterator.next(PathComponentIterator.java:33)
	at org.apache.cayenne.access.trans.QueryAssemblerHelper.appendObjPath(QueryAssemblerHelper.java:114)
	at org.apache.cayenne.access.trans.QualifierTranslator.objectNode(QualifierTranslator.java:366)

The fix is rather simple - register the aliases in the query metadata (i.e. make the method
do what it is supposed to do).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message