cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arseni Bulatski (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (CAY-2541) Performing query with expression with ObjectId throws NPE in some cases
Date Wed, 19 Jun 2019 12:25:00 GMT

     [ https://issues.apache.org/jira/browse/CAY-2541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Arseni Bulatski reassigned CAY-2541:
------------------------------------

    Assignee: Arseni Bulatski

> Performing query with expression with ObjectId throws NPE in some cases
> -----------------------------------------------------------------------
>
>                 Key: CAY-2541
>                 URL: https://issues.apache.org/jira/browse/CAY-2541
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.0.2, 4.1.B1
>            Reporter: Arseni Bulatski
>            Assignee: Arseni Bulatski
>            Priority: Major
>             Fix For: 4.2.M1
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> NPE when using expression with ObjectId.
> Case:
> ObjectId id = new ObjectId("Artist", "ID", 1);
> ASTDbPath astDbPath = new ASTDbPath("ID");
> ASTScalar astScalar = new ASTScalar(id);
> ASTEqual astEqual = new ASTEqual();
> astEqual.setOperand(0, astDbPath);
> astEqual.setOperand(1, astScalar);
> ObjectSelect.query(Artist.class)
>  .where(astEqual)
>  .selectFirst(context);
>  
> StackTrace:
> java.lang.NullPointerException
>  at org.apache.cayenne.access.translator.select.QualifierTranslator.appendObjectMatch(QualifierTranslator.java:205)
>  at org.apache.cayenne.access.translator.select.QualifierTranslator.endNode(QualifierTranslator.java:483)
>  at org.apache.cayenne.exp.Expression.traverse(Expression.java:609)
>  at org.apache.cayenne.exp.Expression.traverse(Expression.java:581)
>  at org.apache.cayenne.access.translator.select.QualifierTranslator.doAppendPart(QualifierTranslator.java:120)
>  at org.apache.cayenne.access.translator.select.QualifierTranslator.doAppendPart(QualifierTranslator.java:87)
>  at org.apache.cayenne.access.translator.select.QueryAssemblerHelper.appendPart(QueryAssemblerHelper.java:76)
>  at org.apache.cayenne.access.translator.select.DefaultSelectTranslator.doTranslate(DefaultSelectTranslator.java:152)
>  at org.apache.cayenne.access.translator.select.QueryAssembler.ensureTranslated(QueryAssembler.java:130)
>  at org.apache.cayenne.access.translator.select.QueryAssembler.getSql(QueryAssembler.java:121)
>  at org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:91)
>  at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:97)
>  at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:293)
>  at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:471)
>  at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:72)
>  at org.apache.cayenne.access.DataDomainQueryAction$2.perform(DataDomainQueryAction.java:446)
>  at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:87)
>  at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:51)
>  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:122)
>  at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:564)
>  at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:748)
>  at org.apache.cayenne.tx.TransactionFilter.onQuery(TransactionFilter.java:49)
>  at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:748)
>  at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:556)
>  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:965)
>  at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:954)
>  at org.apache.cayenne.BaseContext.select(BaseContext.java:307)
>  at org.apache.cayenne.BaseContext.selectFirst(BaseContext.java:331)
>  at org.apache.cayenne.query.ObjectSelect.selectFirst(ObjectSelect.java:660)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message