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: Incomplete
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Tregubova
Votes: 1
Watchers: 1

If you were logged in you would be able to see more operations.
DataNucleus JDO Query Processor

Searching fails for composite OR filter on empty list collection

Created: 05/Feb/13 07:28 PM   Updated: 11/Feb/13 02:40 PM   Resolved: 11/Feb/13 02:39 PM
Component/s: None
Affects Version/s: 3.0.2
Fix Version/s: None

Datastore: MongoDB
Severity: Production

 Description  « Hide
1. There is collection in MongoDB with 2 collection fields - parts and numbers.

2. Persist entity contained the following values:
      parts - [] (empty list)
      numbers - ["12"] (list of one element "12")
3. Trying to do search by the following filter:
       parts.contains(contains_param_0) && contains_param_0.matches(parameter_2)

   parameter_1 = "12" (String type)
   parameter_2 = "_12" (String type)

Expected result: found one entity

Actual result: no entity was found

Possible cause:
   class: JavaQueryEvaluator
   method: evaluateBooleanExpression
   code fragment:

      if (vnse.getValues() == null || vnse.getValues().length == 0)
                // No possible values for the variable so fails
                return Boolean.FALSE;

So, as we have empty list we return Boolean.FALSE for first filter expression:
       parts.contains(contains_param_0) && contains_param_0.matches(parameter_2)
and ignore the second one after OR operator.


Andy Jefferson added a comment - 08/Feb/13 03:08 PM
What has this "issue" got to do with the annotation processor for generating typesafe query meta classes ?
Also you haven't attached a valid DataNucleus testcase as per the front page of JIRA, and all of the DataNucleus docs, hence won't be considered til it has that

Andy Jefferson made changes - 08/Feb/13 03:08 PM
Field Original Value New Value
Priority Major [ 3 ] Incomplete [ 6 ]
Andy Jefferson added a comment - 11/Feb/13 02:39 PM
Nothing to do with an annotation processor that generates query typesafe classes (where this was raised). No testcase was provided either as per
NUCMONGODB is the project for the MongoDB plugin, and if you raise an issue on that a testcase is a prerequisite

Andy Jefferson made changes - 11/Feb/13 02:39 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Incomplete [ 4 ]
Andy Jefferson made changes - 11/Feb/13 02:40 PM
Status Resolved [ 5 ] Closed [ 6 ]