Package org.mongojack.internal.query

Examples of org.mongojack.internal.query.CollectionQueryCondition


                }
                return serializeQueryField(simple.getValue(), serializer,
                        serializerProvider, key);
            }
        } else if (condition instanceof CollectionQueryCondition) {
            CollectionQueryCondition coll = (CollectionQueryCondition) condition;
            if (!key.startsWith("$")) {
                serializer = findQuerySerializer(coll.targetIsCollection(),
                        key, serializerProvider, serializer);
            }
            List<Object> serializedConditions = new ArrayList<Object>();
            for (QueryCondition item : coll.getValues()) {
                serializedConditions.add(serializeQueryCondition(
                        serializerProvider, serializer, "$", item));
            }
            return serializedConditions;
        } else {
View Full Code Here


            return this;
        }

        @Override
        protected Query putGroup(String op, Query... expressions) {
            CollectionQueryCondition condition;
            QueryCondition existing = query.get(op);
            if (existing == null) {
                condition = new CollectionQueryCondition();
                query.put(op, condition);
            } else if (existing instanceof CollectionQueryCondition) {
                condition = (CollectionQueryCondition) existing;
            } else {
                throw new IllegalStateException("Expecting collection for "
                        + op);
            }
            List<QueryCondition> conditions = new ArrayList<QueryCondition>();
            for (Query query : expressions) {
                conditions.add(new CompoundQueryCondition(query));
            }
            condition.addAll(conditions);
            return this;
        }
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

            List<QueryCondition> conditions = new ArrayList<QueryCondition>();
            for (Object value : values) {
                conditions.add(new SimpleQueryCondition(value));
            }
            return put(field, op,
                    new CollectionQueryCondition(conditions, true));
        }
View Full Code Here

TOP

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

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.