code: private Query createSingleValueConstraint(Query q, String propName)
     {
        // get nodes with multi-values in propName
        Query mvp = new JcrTermQuery(new Term(FieldNames.MVP, propName));
        // now negate, that gives the nodes that have propName as single
        // values but also all others
        Query svp = new NotQuery(mvp);
        // now join the two, which will result in those nodes where propName
        // only contains a single value. This works because q already restricts
        // the result to those nodes that have a property propName
        BooleanQuery and = new BooleanQuery();
        and.add(q, Occur.MUST);
        and.add(svp, Occur.MUST);
        return and;
     }
docs: Wraps a constraint query around <code>q</code> that limits the nodes to
  those where <code>propName</code> is the name of a single value property
  on the node instance.
  
  @param q
  the query to wrap.
  @param propName
  the name of a property that only has one value.
  @return the wrapped query <code>q</code>.