title: JCR SQL2 query: binding of ISDESCENDANTNODE param
body: <p>I'm writing a JCR SQL2 query that lists all the nodes of given type that are descendants of a certain path.
  When I write my query like this:</p>
  
  <pre><code>Query query = queryManager.createQuery(
      "SELECT * FROM [cq:PageContent] where ISDESCENDANTNODE(\"/content\") AND ([sling:resourceType] = $resourceType)", Query.JCR_SQL2);
  query.bindValue("resourceType", session.getValueFactory().createValue("my-type"));
  </code></pre>
  
  <p>it works fine, but when I try to bind what's under ISDESCENDANTNODE like this:</p>
  
  <pre><code>Query query = queryManager.createQuery(
      "SELECT * FROM [cq:PageContent] where ISDESCENDANTNODE($base) AND ([sling:resourceType] = $resourceType)", Query.JCR_SQL2);
  query.bindValue("base", session.getValueFactory().createValue("/content"));
  query.bindValue("resourceType", session.getValueFactory().createValue("my-type"));
  </code></pre>
  
  <p>an exception is thrown on query.bindValue("base", ...):</p>
  
  <blockquote>
    <p>"javax.jcr.query.InvalidQueryException: java.text.ParseException: Query: SELECT * FROM [cq:PageContent] where ISDESCENDANTNODE($base(*)) AND ([sling:resourceType] = $resourceType); expected: )"</p>
  </blockquote>
  
  <p>I know I can just concatenate the parameter value into the query, but I think it's a bad practice.</p>