Package com.ctp.cdi.query.builder.postprocessor

Examples of com.ctp.cdi.query.builder.postprocessor.OrderByQueryStringPostProcessor


        this.context = context;
    }

    @Override
    public <X> QueryResult<T> orderAsc(SingularAttribute<T, X> attribute) {
        context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(attribute, OrderDirection.ASC));
        return this;
    }
View Full Code Here


        return this;
    }
   
    @Override
    public QueryResult<T> orderAsc(String attribute) {
        context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(attribute, OrderDirection.ASC));
        return this;
    }
View Full Code Here

        return this;
    }

    @Override
    public <X> QueryResult<T> orderDesc(SingularAttribute<T, X> attribute) {
        context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(attribute, OrderDirection.DESC));
        return this;
    }
View Full Code Here

        return this;
    }
   
    @Override
    public QueryResult<T> orderDesc(String attribute) {
        context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(attribute, OrderDirection.DESC));
        return this;
    }
View Full Code Here

    }

    private <X> QueryResult<T> changeOrder(ChangeOrder changeOrder) {
        for (QueryStringPostProcessor processor : context.getQueryStringPostProcessors()) {
            if (processor instanceof OrderByQueryStringPostProcessor) {
                OrderByQueryStringPostProcessor orderBy = (OrderByQueryStringPostProcessor) processor;
                if (changeOrder.matches(orderBy)) {
                    orderBy.changeDirection();
                    return this;
                }
            }
        }
        changeOrder.addDefault();
View Full Code Here

        this.context = context;
    }

    @Override
    public <X> QueryResult<T> orderAsc(SingularAttribute<T, X> order) {
        context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(order, "asc"));
        return this;
    }
View Full Code Here

        return this;
    }
   
    @Override
    public QueryResult<T> orderAsc(String order) {
        context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(order, "asc"));
        return this;
    }
View Full Code Here

        return this;
    }

    @Override
    public <X> QueryResult<T> orderDesc(SingularAttribute<T, X> order) {
        context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(order, "desc"));
        return this;
    }
View Full Code Here

        return this;
    }
   
    @Override
    public QueryResult<T> orderDesc(String order) {
        context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(order, "desc"));
        return this;
    }
View Full Code Here

TOP

Related Classes of com.ctp.cdi.query.builder.postprocessor.OrderByQueryStringPostProcessor

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.