Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: nae gogu
Votes: 0
Watchers: 0

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 (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.

Sort Order: Ascending order - Click to sort in descending order
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.

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

Andy Jefferson added a comment - 03/Feb/12 09:13 AM
SVN trunk and branches/3.0 both pass