Package org.apache.cxf.jaxrs.ext.search

Examples of org.apache.cxf.jaxrs.ext.search.PrimitiveStatement


            builder = em.getCriteriaBuilder();
            cq = builder.createQuery(tClass);
            root = cq.from(tClass);
            predStack.push(new ArrayList<Predicate>());
        }
        PrimitiveStatement statement = sc.getStatement();
        if (statement != null) {
            if (statement.getProperty() != null) {
                predStack.peek().add(buildPredicate(sc.getConditionType(),
                                                    statement.getProperty(),
                                                    statement.getValue()));
            }
        } else {
            predStack.push(new ArrayList<Predicate>());
            for (SearchCondition<T> condition : sc.getSearchConditions()) {
                condition.accept(this);
View Full Code Here


    public void setContentsFieldMap(Map<String, String> map) {
        this.contentsFieldMap = map;
    }
   
    public void visit(SearchCondition<T> sc) {
        PrimitiveStatement statement = sc.getStatement();
        if (statement != null) {
            if (statement.getProperty() != null) {
                queryStack.peek().add(buildSimpleQuery(sc.getConditionType(),
                                         statement.getProperty(),
                                         statement.getValue()));
            }
        } else {
            queryStack.push(new ArrayList<Query>());
            for (SearchCondition<T> condition : sc.getSearchConditions()) {
                condition.accept(this);
View Full Code Here

        SearchCondition<Condition> filter = parser.parse("name==ami*;level=gt=10");
        assertEquals(ConditionType.AND, filter.getConditionType());

        List<SearchCondition<Condition>> conditions = filter.getSearchConditions();
        assertEquals(2, conditions.size());
        PrimitiveStatement st1 = conditions.get(0).getStatement();
        PrimitiveStatement st2 = conditions.get(1).getStatement();
        assertTrue((ConditionType.EQUALS.equals(st1.getCondition())
            && ConditionType.GREATER_THAN.equals(st2.getCondition()))
            || (ConditionType.EQUALS.equals(st2.getCondition())
                && ConditionType.GREATER_THAN.equals(st1.getCondition())));

        assertTrue(filter.isMet(new Condition("amichalec", 12, new Date())));
        assertTrue(filter.isMet(new Condition("ami", 12, new Date())));
        assertFalse(filter.isMet(new Condition("ami", 8, null)));
View Full Code Here

        assertEquals(ConditionType.OR, filter.getConditionType());

        List<SearchCondition<Condition>> conditions = filter.getSearchConditions();
        assertEquals(2, conditions.size());

        PrimitiveStatement st1 = conditions.get(0).getStatement();
        PrimitiveStatement st2 = conditions.get(1).getStatement();
        assertTrue((ConditionType.EQUALS.equals(st1.getCondition())
            && ConditionType.GREATER_THAN.equals(st2.getCondition()))
            || (ConditionType.EQUALS.equals(st2.getCondition())
                && ConditionType.GREATER_THAN.equals(st1.getCondition())));

        assertTrue(filter.isMet(new Condition("ami", 0, new Date())));
        assertTrue(filter.isMet(new Condition("foo", 20, null)));
        assertFalse(filter.isMet(new Condition("foo", 0, null)));
View Full Code Here

    public void setContentsFieldMap(Map<String, String> map) {
        this.contentsFieldMap = map;
    }
   
    public void visit(SearchCondition<T> sc) {
        PrimitiveStatement statement = sc.getStatement();
        if (statement != null) {
            if (statement.getProperty() != null) {
                queryStack.peek().add(buildSimpleQuery(sc.getConditionType(),
                                         statement.getProperty(),
                                         statement.getValue()));
            }
        } else {
            queryStack.push(new ArrayList<Query>());
            for (SearchCondition<T> condition : sc.getSearchConditions()) {
                condition.accept(this);
View Full Code Here

    }
   
    public void visit(SearchCondition<T> sc) {
        StringBuilder sb = getStringBuilder();
       
        PrimitiveStatement statement = sc.getStatement();
        if (statement != null) {
            if (statement.getProperty() != null) {
                String name = getRealPropertyName(statement.getProperty());
                String value = getPropertyValue(name, statement.getValue());
                validatePropertyValue(name, value);
               
                value = SearchUtils.toSqlWildcardString(value, isWildcardStringMatch());
                               
                if (tableAlias != null) {
View Full Code Here

    public void setContentsFieldMap(Map<String, String> map) {
        this.contentsFieldMap = map;
    }
   
    public void visit(SearchCondition<T> sc) {
        PrimitiveStatement statement = sc.getStatement();
        if (statement != null) {
            if (statement.getProperty() != null) {
                queryStack.peek().add(buildSimpleQuery(sc.getConditionType(),
                                         statement.getProperty(),
                                         statement.getValue()));
            }
        } else {
            queryStack.push(new ArrayList<Query>());
            for (SearchCondition<T> condition : sc.getSearchConditions()) {
                condition.accept(this);
View Full Code Here

    public void setContentsFieldMap(Map<String, String> map) {
        this.contentsFieldMap = map;
    }
   
    public void visit(SearchCondition<T> sc) {
        PrimitiveStatement statement = sc.getStatement();
        if (statement != null) {
            if (statement.getProperty() != null) {
                queryStack.peek().add(buildSimpleQuery(sc.getConditionType(),
                                         statement.getProperty(),
                                         statement.getValue()));
            }
        } else {
            queryStack.push(new ArrayList<Query>());
            for (SearchCondition<T> condition : sc.getSearchConditions()) {
                condition.accept(this);
View Full Code Here

    }
   
    public void visit(SearchCondition<T> sc) {
        StringBuilder sb = getStringBuilder();
       
        PrimitiveStatement statement = sc.getStatement();
        if (statement != null) {
            if (statement.getProperty() != null) {
                String name = getRealPropertyName(statement.getProperty());
                String originalValue = getPropertyValue(name, statement.getValue());
                validatePropertyValue(name, originalValue);
               
                String value = SearchUtils.toSqlWildcardString(originalValue, isWildcardStringMatch());
                value = SearchUtils.duplicateSingleQuoteIfNeeded(value);
               
View Full Code Here

        this.familyMap = familyMap;
        queryStack.push(new ArrayList<Filter>());
    }
   
    public void visit(SearchCondition<T> sc) {
        PrimitiveStatement statement = sc.getStatement();
        if (statement != null) {
            if (statement.getProperty() != null) {
                queryStack.peek().add(buildSimpleQuery(sc.getConditionType(),
                                         statement.getProperty(),
                                         statement.getValue()));
            }
        } else {
            queryStack.push(new ArrayList<Filter>());
            for (SearchCondition<T> condition : sc.getSearchConditions()) {
                condition.accept(this);
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.ext.search.PrimitiveStatement

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.