/** * @param kind * @param clazz * @param q * @param <T> * @return */ public <T> Query<T> createQuery(String kind, Class<T> clazz, DBObject q) { return new QueryImpl<T>(clazz, db.getCollection(kind), this, q); }
/** * @param kind * @param q * @param <T> * @return */ public <T> Query<T> createQuery(Class<T> kind, DBObject q) { return new QueryImpl<T>(kind, getCollection(kind), this, q); }
/** * @param coll * @param example * @param <T> * @return */ private <T> Query<T> queryByExample(DBCollection coll, T example) { //TODO: think about remove className from baseQuery param below. return new QueryImpl<T>((Class<T>) example.getClass(), coll, this, entityToDBObj(example, new HashMap<Object, DBObject>())); }
/** * @param clazz * @param <T> * @return */ public <T> Query<T> createQuery(Class<T> clazz) { return new QueryImpl<T>(clazz, getCollection(clazz), this); }
/** * @param kind * @param clazz * @param <T> * @return */ public <T> Query<T> createQuery(String kind, Class<T> clazz) { return new QueryImpl<T>(clazz, db.getCollection(kind), this); }
/** * @param kind * @param clazz * @param <T> * @return */ public <T> Query<T> find(String kind, Class<T> clazz) { return new QueryImpl<T>(clazz, getCollection(kind), this); }
@Override public QueryImpl<T> clone() { QueryImpl<T> n = new QueryImpl<T>(clazz, dbColl, ds); n.batchSize = batchSize; n.cache = this.ds.getMapper().createEntityCache(); // fresh cache n.fields = fields == null ? null : Arrays.copyOf(fields, fields.length); n.includeFields = includeFields; n.indexHint = indexHint; n.limit = limit; n.noTimeout = noTimeout; n.query = n; // feels weird, correct? n.offset = offset; n.readPref = readPref; n.snapshotted = snapshotted; n.validateName = validateName; n.validateType = validateType; n.sort = (BasicDBObject) (sort == null ? null : sort.clone()); n.baseQuery = (BasicDBObject) (baseQuery == null ? null : baseQuery.clone()); // fields from superclass n.attachedTo = attachedTo; n.children = children == null ? null : new ArrayList<Criteria>(children); n.tail = tail; n.tail_await_data = tail_await_data; return n; }
baseQ = new QueryImpl(outputType, db.getCollection(mrRes.getOutputCollectionName()), this);