This content has been marked as final.
Show 3 replies
-
1. Re: JCR Query in Modeshape returns no result when empty string used in comparison
rhauch Mar 17, 2014 4:19 PM (in response to valeriy.shtanko)Please open an issue in our JIRA. We should be able to use criteria that checks for an empty string, and for a 0-length string as well. (Did you try that?)
-
2. Re: JCR Query in Modeshape returns no result when empty string used in comparison
valeriy.shtanko Mar 18, 2014 5:08 AM (in response to rhauch)I created issue
MODE-2174 -
3. Re: Re: JCR Query in Modeshape returns no result when empty string used in comparison
rhauch Aug 21, 2014 7:05 PM (in response to valeriy.shtanko)I finally got around to testing this, and the existing code works correctly. The following criteria:
... WHERE [car:engine] = ''
applied only to non-null property values. Also, at least as of 4.0.0.Beta1, even when a property value is an empty string the above criteria works correctly.
Note that the correct way to find nodes where the property value is null or empty is to use:
... WHERE [car:engine] IS NULL OR [car:engine] = ''
But the following also works, even when the property value is null:
... WHERE LENGTH([car:engine]) == 0