Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2053

Outer join and two like constrain results NPE

XMLWordPrintable

      Query:

      SELECT 
      FROM [test:Parent] as p 
      LEFT OUTER JOIN [test:Child] as c ON ISCHILDNODE(c, p) 
      WHERE 
       p.[test:parentName] like 'name2%' or c.[test:childName] like 'name2%'
      

      Finished with NPE:

      java.lang.NullPointerException
      	at org.modeshape.jcr.query.process.SelectComponent$17.satisfiesConstraints(SelectComponent.java:361)
      	at org.modeshape.jcr.query.process.SelectComponent$1.satisfiesConstraints(SelectComponent.java:159)
      	at org.modeshape.jcr.query.process.SelectComponent.execute(SelectComponent.java:99)
      	at org.modeshape.jcr.query.process.ProjectComponent.execute(ProjectComponent.java:43)
      	at org.modeshape.jcr.query.process.QueryProcessor.execute(QueryProcessor.java:100)
      	at org.modeshape.jcr.query.process.QueryEngine.execute(QueryEngine.java:140)
      	at org.modeshape.jcr.query.lucene.LuceneQueryEngine$1.getResults(LuceneQueryEngine.java:163)
      	at org.modeshape.jcr.query.JcrQuery.execute(JcrQuery.java:123)
      	at org.modeshape.jcr.query.JcrQuery.execute(JcrQuery.java:52)
      

      problem is here:
      SelectComponent.java:
      final Pattern pattern = createRegexFromLikeExpression(types.asString(rhs));
      pattern always null:

      protected static Pattern createRegexFromLikeExpression( String likeExpression ) {
         return null;
      }
      

      function should look something like this:

      protected static Pattern createRegexFromLikeExpression( String likeExpression ) {
        return Pattern.compile(CompareStringQuery.toRegularExpression(likeExpression));
      }
      

              hchiorean Horia Chiorean (Inactive)
              ybrig Yury Brigadirenko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: