use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class NodeLocalNameTest method testDateLiteral.
public void testDateLiteral() throws RepositoryException {
Value literal = superuser.getValueFactory().createValue(Calendar.getInstance());
QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, literal);
checkQOM(qom, new Node[] {});
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class NodeLocalNameTest method testBooleanLiteral.
public void testBooleanLiteral() throws RepositoryException {
Value literal = superuser.getValueFactory().createValue(true);
QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, literal);
checkQOM(qom, new Node[] {});
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class NodeLocalNameTest method testReferenceLiteral.
public void testReferenceLiteral() throws RepositoryException, NotExecutableException {
ensureMixinType(node1, mixReferenceable);
superuser.save();
Value literal = superuser.getValueFactory().createValue(node1);
QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, literal);
checkQOM(qom, new Node[] {});
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class NodeLocalNameTest method checkOperatorSingleLiteral.
private void checkOperatorSingleLiteral(String literal, String operator, boolean matches) throws RepositoryException {
Value value = superuser.getValueFactory().createValue(literal);
QueryObjectModel qom = createQuery(operator, value);
checkQOM(qom, matches ? new Node[] { node1 } : new Node[0]);
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class SQL2PathEscapingTest method testGetChildrenApiDirect.
/**
* will build a query directly via the api using a spaced path
*
* @throws Exception
*/
public void testGetChildrenApiDirect() throws Exception {
QueryObjectModelFactory qomf = qm.getQOMFactory();
Source source1 = qomf.selector(NodeType.NT_BASE, "selector");
Column[] columns = new Column[] { qomf.column("selector", null, null) };
Constraint constraint2 = qomf.childNode("selector", n1.getPath());
QueryObjectModel qom = qomf.createQuery(source1, constraint2, null, columns);
checkResult(qom.execute(), 2);
}
Aggregations