Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.Selector


            return readAny();
        }
    }

    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            JoinType type;
            if (readIf("RIGHT")) {
View Full Code Here


    }

    private Set<String> getSelectorNames(Source source)
            throws RepositoryException {
        if (source instanceof Selector) {
            Selector selector = (Selector) source;
            return Collections.singleton(selector.getSelectorName());
        } else if (source instanceof Join) {
            Join join = (Join) source;
            Set<String> set = new LinkedHashSet<String>();
            set.addAll(getSelectorNames(join.getLeft()));
            set.addAll(getSelectorNames(join.getRight()));
View Full Code Here

    }

    private Map<String, NodeType> getSelectorNames(Source source)
            throws RepositoryException {
        if (source instanceof Selector) {
            Selector selector = (Selector) source;
            return Collections.singletonMap(selector.getSelectorName(),
                    getNodeType(selector));
        } else if (source instanceof Join) {
            Join join = (Join) source;
            Map<String, NodeType> map = new LinkedHashMap<String, NodeType>();
            map.putAll(getSelectorNames(join.getLeft()));
View Full Code Here

            return readAny();
        }
    }

    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            JoinType type;
            if (readIf("RIGHT")) {
View Full Code Here

    // query Trash Structure 2
    QueryObjectModelFactory fac = session.getWorkspace().getQueryManager().getQOMFactory();
    final String selectorName = "selector"; //$NON-NLS-1$

    // selector
    final Selector selector = fac.selector( "nt:base", selectorName ); //$NON-NLS-1$
    // constraint1
    Constraint origParentFolderPathConstraint =
        fac.comparison( fac.propertyValue( selectorName, pentahoJcrConstants.getPHO_ORIGPARENTFOLDERPATH() ),
            QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, fac.literal( session.getValueFactory().createValue(
                origParentFolderPath ) ) );
View Full Code Here

    final Node nodeUserFolder = mock( Node.class );
    when( nodeUserFolder.hasNode( anyString() ) ).thenReturn( true );
    when( nodeUserFolder.getNode( anyString() ) ).thenReturn( nodeTrash );
    when( nodeUserFolder.getIdentifier() ).thenReturn( "nodeUserFolderID" );

    final Selector selector = mock( Selector.class );

    final Value value = mock( Value.class );

    final ValueFactory valueFactory = mock( ValueFactory.class );
    when( valueFactory.createValue( anyString() ) ).thenReturn( value );
View Full Code Here

                s.toString());
    }

    @Test
    public void selector() throws RepositoryException {
        Selector s = f.selector("nodeTypeName", "selectorName");
        assertEquals("nodeTypeName", s.getNodeTypeName());
        assertEquals("selectorName", s.getSelectorName());
        assertEquals("[nodeTypeName] AS [selectorName]", s.toString());
        assertEquals("[n]", f.selector("n"null).toString());
           }
View Full Code Here

        assertEquals("UPPER(LENGTH([selectorName].[propertyName]))", u.toString());
    }

    @Test
    public void createQuery() throws RepositoryException {
        Selector s = f.selector("nodeTypeName", "x");
        BindVariableValue b = f.bindVariable("var");
        Constraint c = f.propertyExistence("x", "c");
        PropertyValue p = f.propertyValue("x", "propertyName");
        c = f.and(f.comparison(p, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, b), c);
        Ordering o = f.ascending(p);
View Full Code Here

            return readAny();
        }
    }

    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            JoinType type;
            if (readIf("RIGHT")) {
View Full Code Here

            return readAny();
        }
    }

    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            JoinType type;
            if (readIf("RIGHT")) {
View Full Code Here

TOP

Related Classes of javax.jcr.query.qom.Selector

Copyright © 2018 www.massapicom. 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.