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)

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.