本文整理了Java中org.mongodb.morphia.query.QueryImpl
类的一些代码示例,展示了QueryImpl
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryImpl
类的具体详情如下:
包路径:org.mongodb.morphia.query.QueryImpl
类名称:QueryImpl
[英]Implementation of Query
[中]查询的实现
代码示例来源:origin: ltsopensource/light-task-scheduler
public <T> Query<T> createQuery(final String collName, final Class<T> clazz) {
DBCollection dbCollection = ds.getDB().getCollection(getCollName(collName));
return new QueryImpl<T>(clazz, dbCollection, ds);
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public QueryImpl<T> cloneQuery() {
final QueryImpl<T> n = new QueryImpl<T>(clazz, dbColl, ds);
n.cache = ds.getMapper().createEntityCache(); // fresh cache
n.includeFields = includeFields;
n.setQuery(n); // feels weird, correct?
n.validateName = validateName;
n.validateType = validateType;
n.baseQuery = copy(baseQuery);
n.options = options != null ? options.copy() : null;
// fields from superclass
n.setAttachedTo(getAttachedTo());
n.setChildren(getChildren() == null ? null : new ArrayList<Criteria>(getChildren()));
return n;
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public <T> Query<T> createQuery(final Datastore datastore, final DBCollection collection, final Class<T> type, final DBObject query) {
final QueryImpl<T> item = new QueryImpl<T>(type, collection, datastore);
if (query != null) {
item.setQueryObject(query);
}
return item;
}
代码示例来源:origin: BlackLabs/play-morphia
public MorphiaQuery(Class<? extends Model> clazz, DBCollection coll,
Datastore ds, int offset, int limit) {
// super(clazz, coll, ds, offset, limit);
q_ = new QueryImpl(clazz, coll, ds).offset(offset).limit(limit);
c_ = clazz;
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public MorphiaIterator<T, T> fetchEmptyEntities(final FindOptions options) {
QueryImpl<T> cloned = cloneQuery();
cloned.getOptions().projection(new BasicDBObject(Mapper.ID_KEY, 1));
cloned.includeFields = true;
return cloned.fetch();
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public MorphiaKeyIterator<T> fetchKeys(final FindOptions options) {
QueryImpl<T> cloned = cloneQuery();
cloned.getOptions().projection(new BasicDBObject(Mapper.ID_KEY, 1));
cloned.includeFields = true;
return new MorphiaKeyIterator<T>(ds, cloned.prepareCursor(options), ds.getMapper(), clazz, dbColl.getName());
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public List<Key<T>> asKeyList() {
return asKeyList(getOptions());
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public List<T> asList() {
return asList(getOptions());
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public Query<T> filter(final String condition, final Object value) {
final String[] parts = condition.trim().split(" ");
if (parts.length < 1 || parts.length > 6) {
throw new IllegalArgumentException("'" + condition + "' is not a legal filter condition");
}
final String prop = parts[0].trim();
final FilterOperator op = (parts.length == 2) ? translate(parts[1]) : FilterOperator.EQUAL;
add(new FieldCriteria(this, prop, op, value));
return this;
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public Query<T> where(final String js) {
add(new WhereCriteria(js));
return this;
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
@Deprecated
public DBObject getQueryObject() {
final DBObject obj = new BasicDBObject();
if (baseQuery != null) {
obj.putAll((BSONObject) baseQuery);
}
addTo(obj);
return obj;
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (!(o instanceof QueryImpl)) {
return false;
}
final QueryImpl<?> query = (QueryImpl<?>) o;
if (validateName != query.validateName) {
return false;
}
if (validateType != query.validateType) {
return false;
}
if (!dbColl.equals(query.dbColl)) {
return false;
}
if (!clazz.equals(query.clazz)) {
return false;
}
if (includeFields != null ? !includeFields.equals(query.includeFields) : query.includeFields != null) {
return false;
}
if (baseQuery != null ? !baseQuery.equals(query.baseQuery) : query.baseQuery != null) {
return false;
}
return compare(options, query.options);
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public Query<T> where(final CodeWScope js) {
add(new WhereCriteria(js));
return this;
}
代码示例来源:origin: ltsopensource/light-task-scheduler
public <T> Query<T> createQuery(final String collName, final Class<T> clazz) {
DBCollection dbCollection = ds.getDB().getCollection(getCollName(collName));
return new QueryImpl<T>(clazz, dbCollection, ds);
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public FieldEnd<? extends CriteriaContainerImpl> criteria(final String field) {
final CriteriaContainerImpl container = new CriteriaContainerImpl(this, CriteriaJoin.AND);
add(container);
return new FieldEndImpl<CriteriaContainerImpl>(this, field, container);
}
代码示例来源:origin: org.mongodb.morphia/morphia
@Override
public <T> Query<T> createQuery(final Datastore datastore) {
return new QueryImpl<T>(null, null, datastore);
}
}
代码示例来源:origin: BlackLabs/play-morphia
public MorphiaQuery(Class<? extends Model> clazz, DBCollection coll,
Datastore ds) {
// super(clazz, coll, ds);
q_ = new QueryImpl(clazz, coll, ds);
c_ = clazz;
}
代码示例来源:origin: com.github.ltsopensource/lts-core
public <T> Query<T> createQuery(final String collName, final Class<T> clazz) {
DBCollection dbCollection = ds.getDB().getCollection(getCollName(collName));
return new QueryImpl<T>(clazz, dbCollection, ds);
}
内容来源于网络,如有侵权,请联系作者删除!