Package org.apache.chemistry.opencmis.server.support.query

Examples of org.apache.chemistry.opencmis.server.support.query.ColumnReference


        protected Integer compareTo(Tree leftChild, Tree rightChild) {
            Object rVal = walkExpr(rightChild);

            // log.debug("retrieve node from where: " +
            // System.identityHashCode(leftChild) + " is " + leftChild);
            ColumnReference colRef = getColumnReference(leftChild);
            PropertyDefinition<?> pd = colRef.getPropertyDefinition();
            Object val = PropertyUtil.getProperty(so, colRef.getPropertyId());
            if (val==null) {
                return null;
            }if (val instanceof List<?>) {
                throw new IllegalStateException("You can't query operators <, <=, ==, !=, >=, > on multi-value properties ");
            } else {
View Full Code Here


        List<CmisSelector> selects = queryObj.getSelectReferences();
        assertTrue(1 == selects.size());
        // nothing should be in where references
        assertTrue(0 == queryObj.getWhereReferences().size());

        ColumnReference colRef = ((ColumnReference)selects.get(0));
        assertTrue(selects.get(0) instanceof ColumnReference);
        assertEquals("abc", colRef.getPropertyQueryName());
    }
View Full Code Here

        assertTrue(1 == selects.size());
        // nothing should be in where references
        assertTrue(0 == queryObj.getWhereReferences().size());
        assertTrue(selects.get(0) instanceof ColumnReference);

        ColumnReference colRef = ((ColumnReference)selects.get(0));
        assertEquals("t1", colRef.getQualifier());
        assertEquals("abc", colRef.getPropertyQueryName());
    }
View Full Code Here

        List<CmisSelector> selects = queryObj.getSelectReferences();
        assertTrue(1 == selects.size());
        // nothing should be in where references
        assertTrue(0 == queryObj.getWhereReferences().size());

        ColumnReference colRef = ((ColumnReference)selects.get(0));
        assertTrue(selects.get(0) instanceof ColumnReference);
        assertEquals(null, colRef.getQualifier());
        assertEquals("*", colRef.getPropertyQueryName());
    }
View Full Code Here

        assertTrue(1 == selects.size());
        // nothing should be in where references
        assertTrue(0 == queryObj.getWhereReferences().size());
        assertTrue(selects.get(0) instanceof ColumnReference);

        ColumnReference colRef = ((ColumnReference)selects.get(0));
        assertEquals("t1", colRef.getQualifier());
        assertEquals("*", colRef.getPropertyQueryName());
    }
View Full Code Here

        assertTrue(1 == selects.size());
        // nothing should be in where references
        assertTrue(0 == queryObj.getWhereReferences().size());
        assertTrue(selects.get(0) instanceof ColumnReference);

        ColumnReference colRef = ((ColumnReference)selects.get(0));
        assertEquals("t2", colRef.getQualifier());
        assertEquals("aaa", colRef.getPropertyQueryName());
    }
View Full Code Here

            return cmp == null ? false : cmp <= 0;
        }

        @Override
        public Boolean walkIn(Tree opNode, Tree colNode, Tree listNode) {
            ColumnReference colRef = getColumnReference(colNode);
            PropertyDefinition<?> pd = colRef.getPropertyDefinition();
            List<Object> literals = onLiteralList(listNode);
            Object prop = PropertyUtil.getProperty(so, colRef.getPropertyId(), pd);

            if (pd.getCardinality() != Cardinality.SINGLE) {
                throw new IllegalStateException("Operator IN only is allowed on single-value properties ");
            } else if (prop == null) {
                return false;
View Full Code Here

        @Override
        public Boolean walkNotIn(Tree opNode, Tree colNode, Tree listNode) {
            // Note just return !walkIn(node, colNode, listNode) is wrong,
            // because
            // then it evaluates to true for null values (not set properties).
            ColumnReference colRef = getColumnReference(colNode);
            PropertyDefinition<?> pd = colRef.getPropertyDefinition();
            Object prop = PropertyUtil.getProperty(so, colRef.getPropertyId(), pd);
            List<Object> literals = onLiteralList(listNode);
            if (pd.getCardinality() != Cardinality.SINGLE) {
                throw new IllegalStateException("Operator IN only is allowed on single-value properties ");
            } else if (prop == null) {
                return false;
View Full Code Here

            }
        }

        @Override
        public Boolean walkInAny(Tree opNode, Tree colNode, Tree listNode) {
            ColumnReference colRef = getColumnReference(colNode);
            PropertyDefinition<?> pd = colRef.getPropertyDefinition();
            PropertyData<?> lVal = so.getProperties().get(colRef.getPropertyId());
            List<Object> literals = onLiteralList(listNode);
            if (pd.getCardinality() != Cardinality.MULTI) {
                throw new IllegalStateException("Operator ANY...IN only is allowed on multi-value properties ");
            } else if (lVal == null) {
                return false;
View Full Code Here

        @Override
        public Boolean walkNotInAny(Tree opNode, Tree colNode, Tree listNode) {
            // Note just return !walkNotInAny(node, colNode, listNode) is
            // wrong, because
            // then it evaluates to true for null values (not set properties).
            ColumnReference colRef = getColumnReference(colNode);
            PropertyDefinition<?> pd = colRef.getPropertyDefinition();
            PropertyData<?> lVal = so.getProperties().get(colRef.getPropertyId());
            List<Object> literals = onLiteralList(listNode);
            if (pd.getCardinality() != Cardinality.MULTI) {
                throw new IllegalStateException("Operator ANY...IN only is allowed on multi-value properties ");
            } else if (lVal == null) {
                return false;
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.server.support.query.ColumnReference

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.