Package org.mongojack.internal.query

Examples of org.mongojack.internal.query.SimpleQueryCondition


    private static Object serializeQueryCondition(
            SerializerProvider serializerProvider, JsonSerializer serializer,
            String key, QueryCondition condition) {
        if (condition instanceof SimpleQueryCondition) {
            SimpleQueryCondition simple = (SimpleQueryCondition) condition;
            if (!simple.requiresSerialization() || simple.getValue() == null) {
                return simple.getValue();
            } else {
                if (!key.startsWith("$")) {
                    serializer = findQuerySerializer(false, key,
                            serializerProvider, serializer);
                }
                return serializeQueryField(simple.getValue(), serializer,
                        serializerProvider, key);
            }
        } else if (condition instanceof CollectionQueryCondition) {
            CollectionQueryCondition coll = (CollectionQueryCondition) condition;
            if (!key.startsWith("$")) {
View Full Code Here


         * @param value
         *            The value to compare to
         * @return the query
         */
        public Q is(String field, Object value) {
            return put(field, new SimpleQueryCondition(value));
        }
View Full Code Here

         *            The value to compare to
         * @return the query
         */
        public Q lessThan(String field, Object value) {
            return put(field, QueryOperators.LT,
                    new SimpleQueryCondition(value));
        }
View Full Code Here

         * @param value
         *            The value to compare to
         * @return the query
         */
        public Q lessThanEquals(String field, Object value) {
            return put(field, QueryOperators.LTE, new SimpleQueryCondition(
                    value));
        }
View Full Code Here

         *            The value to compare to
         * @return the query
         */
        public Q greaterThan(String field, Object value) {
            return put(field, QueryOperators.GT,
                    new SimpleQueryCondition(value));
        }
View Full Code Here

         * @param value
         *            The value to compare to
         * @return the query
         */
        public Q greaterThanEquals(String field, Object value) {
            return put(field, QueryOperators.GTE, new SimpleQueryCondition(
                    value));
        }
View Full Code Here

         *            The value to compare to
         * @return the query
         */
        public Q notEquals(String field, Object value) {
            return put(field, QueryOperators.NE,
                    new SimpleQueryCondition(value));
        }
View Full Code Here

        public Q mod(String field, Number mod, Number value) {
            return put(
                    field,
                    QueryOperators.MOD,
                    new CollectionQueryCondition(Arrays
                            .<QueryCondition> asList(new SimpleQueryCondition(
                                    mod, false),
                                    new SimpleQueryCondition(value)), false));
        }
View Full Code Here

         * @param values
         *            The values to compare to
         * @return the query
         */
        public Q all(String field, Collection<?> values) {
            return put(field, QueryOperators.ALL, new SimpleQueryCondition(
                    values));
        }
View Full Code Here

         * @param size
         *            The value to compare
         * @return the query
         */
        public Q size(String field, int size) {
            return put(field, QueryOperators.SIZE, new SimpleQueryCondition(
                    size, false));
        }
View Full Code Here

TOP

Related Classes of org.mongojack.internal.query.SimpleQueryCondition

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.