DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCMONGODB-61
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: nae gogu
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store MongoDB

NPE in MongoBooleanExpression for subclass query

Created: 02/Feb/12 04:01 PM   Updated: 05/Mar/12 08:43 PM   Resolved: 03/Feb/12 09:13 AM
Component/s: Query
Affects Version/s: 3.0.5
Fix Version/s: 3.0.6, 3.1.0.m1

File Attachments: 1. Zip Archive NUCMONGODB-61.zip (5 kB)


Datastore: MongoDB


 Description  « Hide
When doing a simple select for a subclass with a discriminator.
select p from SubProfile p

In JPQLQuery.class performExecute(Map) a filterExpr is created :

filterExpr = new MongoBooleanExpression(fieldName, discVal, MongoOperator.OP_EQ); // line 259

with something like this { "<dscrimitator_column>" : "<discriminator_value>" }

Because of this a few lines below this is executed

filterExpr = new MongoBooleanExpression(filterExpr, userFilterExpr, MongoOperator.OP_AND); // line 294

witch failes with NullPointerException because userFilterExpr is null.

nae gogu added a comment - 02/Feb/12 04:17 PM
same error in the same place if trying a simple CriteriaQuery for the subclass

Andy Jefferson added a comment - 02/Feb/12 04:29 PM
All issues require testcases, as stated clearly enough in the docs and front page of JIRA.
http://www.datanucleus.org/project/problem_jpa_testcase.html

nae gogu added a comment - 02/Feb/12 05:47 PM
sorry. here is the test case as in
http://www.datanucleus.org/project/problem_jpa_testcase.html
thank you for your quick response!

nae gogu made changes - 02/Feb/12 05:47 PM
Field Original Value New Value
Attachment NUCMONGODB-61.zip [ 11580 ]
Andy Jefferson added a comment - 03/Feb/12 09:13 AM
SVN trunk and branches/3.0 both pass

Andy Jefferson made changes - 03/Feb/12 09:13 AM
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Fix Version/s 3.0.6 [ 11445 ]
Fix Version/s 3.1.0.m1 [ 11470 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 05/Mar/12 08:43 PM
Status Resolved [ 5 ] Closed [ 6 ]