Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.Column


    public void testCreateQueryFromSourceWithConstraintOrderingAndColumn() throws RepositoryException {
        Source selector = qomFactory.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qomFactory.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qomFactory.ascending(propValue);
        Column column = qomFactory.column(SELECTOR_NAME1, propertyName1, null);
        QueryObjectModel qom = qomFactory.createQuery(selector, propExist,
                new Ordering[]{ordering}, new Column[]{column});
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
        assertEquals("Wrong size of orderings", 1, qom.getOrderings().length);
View Full Code Here


            if (c.propertyName == null) {
                for (Selector selector : selectors) {
                    if (c.selectorName == null
                            || c.selectorName
                                    .equals(selector.getSelectorName())) {
                        Column column = factory.column(selector
                                .getSelectorName(), null, null);
                        columns.add(column);
                    }
                }
            } else {
                Column column;
                if (c.selectorName != null) {
                    column = factory.column(c.selectorName, c.propertyName, c.columnName);
                } else if (c.columnName != null) {
                    column = factory.column(getOnlySelectorName(), c.propertyName, c.columnName);
                } else {
View Full Code Here

                if (c.propertyName == null) {
                    for (Selector selector : selectors) {
                        if (c.selectorName == null
                                || c.selectorName
                                        .equals(selector.getSelectorName())) {
                            Column column = factory.column(selector
                                    .getSelectorName(), null, null);
                            columns.add(column);
                        }
                    }
                } else {
                    Column column;
                    if (c.selectorName != null) {
                        column = factory.column(c.selectorName, c.propertyName, c.columnName);
                    } else if (c.columnName != null) {
                        column = factory.column(getOnlySelectorName(c.propertyName), c.propertyName, c.columnName);
                    } else {
View Full Code Here

        assertEquals("parentSelectorName", c.getParentSelectorName());
    }

    @Test
    public void column() throws RepositoryException {
        Column c = f.column("selectorName", "propertyName", "columnName");
        assertEquals("selectorName", c.getSelectorName());
        assertEquals("propertyName", c.getPropertyName());
        assertEquals("columnName", c.getColumnName());
    }
View Full Code Here

        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);
        Column col = f.column("selectorName", "propertyName", "columnName");
        Ordering[] ords = new Ordering[]{o};
        Column[] cols = new Column[]{col};
        QueryObjectModel q = f.createQuery(s, c, ords, cols);
        // assertEquals(Query.JCR_SQL2, q.getLanguage());
        String[] bv = q.getBindVariableNames();
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#column(String, String, String)}
     */
    public void testColumn() throws RepositoryException {
        Column col = qf.column(SELECTOR_NAME1, propertyName1, propertyName1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, col.getSelectorName());
        assertEquals("Wrong property name", propertyName1, col.getPropertyName());
        assertEquals("Wrong column name", propertyName1, col.getColumnName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#column(String, String, String)}
     */
    public void testColumnAllProperties() throws RepositoryException {
        Column col = qf.column(SELECTOR_NAME1, null, null);
        assertEquals("Wrong selector name", SELECTOR_NAME1, col.getSelectorName());
        assertNull("Property name must be null", col.getPropertyName());
        assertNull("Column name must be null", col.getColumnName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#column(String, String, String)}
     */
    public void testColumnWithColumnName() throws RepositoryException {
        Column col = qf.column(SELECTOR_NAME1, propertyName1, COLUMN_NAME);
        assertEquals("Wrong selector name", SELECTOR_NAME1, col.getSelectorName());
        assertEquals("Wrong property name", propertyName1, col.getPropertyName());
        assertEquals("Wrong column name", COLUMN_NAME, col.getColumnName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#column(String, String, String)}
     */
    public void testColumnWithSelector() throws RepositoryException {
        Column col = qf.column(SELECTOR_NAME1, propertyName1, COLUMN_NAME);
        assertEquals("Wrong selector name", SELECTOR_NAME1, col.getSelectorName());
        assertEquals("Wrong property name", propertyName1, col.getPropertyName());
        assertEquals("Wrong column name", COLUMN_NAME, col.getColumnName());
    }
View Full Code Here

    public void testCreateQueryWithConstraintOrderingAndColumn() throws RepositoryException {
        Selector selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qf.ascending(propValue);
        Column column = qf.column(SELECTOR_NAME1, propertyName1, propertyName1);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
                new Ordering[]{ordering}, new Column[]{column});
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
        assertEquals("Wrong size of orderings", 1, qom.getOrderings().length);
View Full Code Here

TOP

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

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.