Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.QueryObjectModelFactory.createQuery()


    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);
    }

    /**
 
View Full Code Here


        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(executeSQL2Query(qom.getStatement()), 2);
    }

}
View Full Code Here

    // AND together constraints
    Constraint allConstraints = fac.and( descendantNodeConstraint, origParentFolderPathConstraint );
    if ( StringUtils.hasLength( filter ) ) {
      allConstraints = fac.and( allConstraints, origNameConstraint );
    }
    Query query = fac.createQuery( selector, allConstraints, null, null );
    QueryResult result =
        session.getWorkspace().getQueryManager().createQuery( query.getStatement(), Query.JCR_JQOM ).execute();

    NodeIterator nodeIter = result.getNodes();
    List<RepositoryFile> deletedFiles = new ArrayList<RepositoryFile>();
View Full Code Here

    when( valueFactory.createValue( anyString() ) ).thenReturn( value );

    final QueryObjectModel queryObjectModel = mock( QueryObjectModel.class );

    final QueryObjectModelFactory qomFactory = mock( QueryObjectModelFactory.class );
    when( qomFactory.createQuery( Matchers.<Source>any(), Matchers.<Constraint>any(), Matchers.<Ordering[]>any(), Matchers.<Column[]>any() ) ).thenReturn( queryObjectModel );
    when( qomFactory.selector( anyString(), anyString() ) ).thenReturn( selector );

    final QueryResult queryResult = mock( QueryResult.class );
    when( queryResult.getNodes() ).thenReturn( nodeIterator );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.