cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Lattermann (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (CAY-1612) EJBQL join, to-many with uncommited (new) objects: Invalid multi-column equals expression.
Date Wed, 07 Sep 2011 19:57:10 GMT

    [ https://issues.apache.org/jira/browse/CAY-1612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099262#comment-13099262
] 

Dirk Lattermann edited comment on CAY-1612 at 9/7/11 7:56 PM:
--------------------------------------------------------------

Source files to reproduce exception, database not even necessary!

      was (Author: dlatt):
    Source files to reproduces, database not even necessary!
  
> EJBQL join, to-many with uncommited (new) objects: Invalid multi-column equals expression.
> ------------------------------------------------------------------------------------------
>
>                 Key: CAY-1612
>                 URL: https://issues.apache.org/jira/browse/CAY-1612
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.0.2, 3.1M2
>         Environment: OpenJDK 6 on Ubuntu 11.04 x64
>            Reporter: Dirk Lattermann
>         Attachments: testcase.tar.gz
>
>
> Entity RelAB has a to-one rel. to A and a to-one rel. to B. A and B have reverse to-many
relationships.
> Using the EJBQLQuery q
> select a from A a join a.arrAB ab where ab.toB = :b
> in an ObjectContext with no changes, Cayenne issues the DB query
> SELECT t0.val AS ec0_0, t0.pk AS ec0_1 FROM tabA t0 INNER JOIN tabAB t1 ON (t0.pk = t1.fkA)
WHERE t1.fkB = ?
> so far, so good. Creating an object of class B:
> B b = oc.newObject(B.class);
> b.setName("nam");
> q.setParameter("b", b);
> // no oc.commitChanges()!
> oc.performQuery(q);
> Cayenne (both 3.0.2 and 3.1M2) now raises the exception
> org.apache.cayenne.ejbql.EJBQLException: [v.3.1M2 Feb 21 2011 12:19:50] Invalid multi-column
equals expression. Expected 2 multi-column operands, got 1
> 	at org.apache.cayenne.access.jdbc.EJBQLConditionTranslator.visitEquals(EJBQLConditionTranslator.java:436)
> 	at org.apache.cayenne.ejbql.parser.EJBQLEquals.visitChild(EJBQLEquals.java:39)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
> 	at org.apache.cayenne.access.jdbc.EJBQLSelectTranslator.visitWhere(EJBQLSelectTranslator.java:116)
> 	at org.apache.cayenne.ejbql.parser.EJBQLWhere.visitNode(EJBQLWhere.java:34)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
> 	at org.apache.cayenne.access.jdbc.EJBQLAction$1.visitSelect(EJBQLAction.java:72)
> 	at org.apache.cayenne.ejbql.parser.EJBQLSelect.visitNode(EJBQLSelect.java:34)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
> 	at org.apache.cayenne.access.jdbc.EJBQLAction.performAction(EJBQLAction.java:66)
> 	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
> 	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:254)
> 	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:422)
> 	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:69)
> 	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:395)
> 	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:824)
> 	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:392)
> 	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
> 	at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:706)
> 	at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:944)
> 	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:696)
> 	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:336)
> 	at org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:104)
> 	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:91)
> 	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:983)
> 	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:972)
> 	at test.Main.main(Main.java:25)
> Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: [v.3.1M2 Feb 21
2011 12:19:50] Query exception.
> 	at org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataDomainQueryAction.java:549)
> 	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:261)
> 	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:422)
> 	at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:69)
> 	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:395)
> 	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:824)
> 	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:392)
> 	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
> 	at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:706)
> 	at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:944)
> 	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:696)
> 	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:336)
> 	at org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:104)
> 	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:91)
> 	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:983)
> 	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:972)
> 	at test.Main.main(Main.java:25)
> Caused by: org.apache.cayenne.ejbql.EJBQLException: [v.3.1M2 Feb 21 2011 12:19:50] Invalid
multi-column equals expression. Expected 2 multi-column operands, got 1
> 	at org.apache.cayenne.access.jdbc.EJBQLConditionTranslator.visitEquals(EJBQLConditionTranslator.java:436)
> 	at org.apache.cayenne.ejbql.parser.EJBQLEquals.visitChild(EJBQLEquals.java:39)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
> 	at org.apache.cayenne.access.jdbc.EJBQLSelectTranslator.visitWhere(EJBQLSelectTranslator.java:116)
> 	at org.apache.cayenne.ejbql.parser.EJBQLWhere.visitNode(EJBQLWhere.java:34)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
> 	at org.apache.cayenne.access.jdbc.EJBQLAction$1.visitSelect(EJBQLAction.java:72)
> 	at org.apache.cayenne.ejbql.parser.EJBQLSelect.visitNode(EJBQLSelect.java:34)
> 	at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
> 	at org.apache.cayenne.access.jdbc.EJBQLAction.performAction(EJBQLAction.java:66)
> 	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
> 	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:254)
> 	... 15 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message