Description
If "r1" is a flattened n..m relationship mapped to "dbr11.dbr12", using a split expression with it results in an exception.
Expression:
query.and(ExpressionFactory.matchAllExp("|r1", values));
org.apache.cayenne.CayenneRuntimeException: [v.4.2.RC1 Jun 03 2022 10:10:32] Query exception. at org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataDomainQueryAction.java:622) at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:279) at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:468) at org.apache.cayenne.access.DataDomainQueryAction.lambda$runQueryInTransaction$1(DataDomainQueryAction.java:444) at org.apache.cayenne.tx.DefaultTransactionManager$BaseTransactionHandler.performInTransaction(DefaultTransactionManager.java:180) at org.apache.cayenne.tx.DefaultTransactionManager$BaseTransactionHandler.performInNewTransaction(DefaultTransactionManager.java:152) at org.apache.cayenne.tx.DefaultTransactionManager$NestedTransactionHandler.handle(DefaultTransactionManager.java:95) at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:62) at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:40) at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:443) at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:127) at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:570) at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:819) at io.bootique.cayenne.v42.junit5.tester.QueryCounter.onQuery(QueryCounter.java:45) at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:818) at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:562) at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:406) at org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:107) at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:94) at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:960) at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:949) at org.apache.cayenne.BaseContext.select(BaseContext.java:307) Caused by: java.lang.IllegalStateException: Non-relationship aliased path part: r1 at org.apache.cayenne.access.translator.select.DbPathProcessor.processAliasedAttribute(DbPathProcessor.java:70) at org.apache.cayenne.access.translator.select.PathProcessor.process(PathProcessor.java:72) at org.apache.cayenne.access.translator.select.PathTranslator.lambda$translatePath$1(PathTranslator.java:57) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705) at org.apache.cayenne.access.translator.select.PathTranslator.translatePath(PathTranslator.java:56) at org.apache.cayenne.access.translator.select.ObjPathProcessor.processRelTermination(ObjPathProcessor.java:137) at org.apache.cayenne.access.translator.select.ObjPathProcessor.processRelationship(ObjPathProcessor.java:116) at org.apache.cayenne.access.translator.select.ObjPathProcessor.processAliasedAttribute(ObjPathProcessor.java:76) at org.apache.cayenne.access.translator.select.PathProcessor.process(PathProcessor.java:72) at org.apache.cayenne.access.translator.select.PathTranslator.lambda$translatePath$0(PathTranslator.java:48) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1737) at org.apache.cayenne.access.translator.select.PathTranslator.translatePath(PathTranslator.java:47) at org.apache.cayenne.access.translator.select.PathTranslator.translatePath(PathTranslator.java:52) at org.apache.cayenne.access.translator.select.QualifierTranslator.expressionNodeToSqlNode(QualifierTranslator.java:155) at org.apache.cayenne.access.translator.select.QualifierTranslator.startNode(QualifierTranslator.java:118) at org.apache.cayenne.exp.Expression.traverse(Expression.java:568) at org.apache.cayenne.exp.Expression.traverse(Expression.java:577) at org.apache.cayenne.exp.Expression.traverse(Expression.java:577) at org.apache.cayenne.exp.Expression.traverse(Expression.java:577) at org.apache.cayenne.exp.Expression.traverse(Expression.java:557) at org.apache.cayenne.access.translator.select.QualifierTranslator.translate(QualifierTranslator.java:96) at org.apache.cayenne.access.translator.select.QualifierTranslationStage.perform(QualifierTranslationStage.java:52) at org.apache.cayenne.access.translator.select.DefaultSelectTranslator.translate(DefaultSelectTranslator.java:98) at org.apache.cayenne.access.translator.select.DefaultSelectTranslator.getSql(DefaultSelectTranslator.java:104) at org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:87) at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:97) at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:273)
Attachments
Issue Links
- is related to
-
CAY-2764 Split expressions do not work with DB relationships
- Closed