K - public abstract class MongodbQuery<K> extends Object implements SimpleQuery<MongodbQuery<K>>, SimpleProjectable<K>
| Constructor and Description |
|---|
MongodbQuery(com.mongodb.DBCollection collection,
com.google.common.base.Function<com.mongodb.DBObject,K> transformer,
MongodbSerializer serializer)
Create a new MongodbQuery instance
|
| Modifier and Type | Method and Description |
|---|---|
<T> AnyEmbeddedBuilder<K> |
anyEmbedded(Path<? extends Collection<T>> collection,
Path<T> target)
Define a constraint for an embedded object
|
long |
count() |
protected com.mongodb.DBCursor |
createCursor() |
protected com.mongodb.DBCursor |
createCursor(com.mongodb.DBCollection collection,
Predicate where,
List<Expression<?>> projection,
QueryModifiers modifiers,
List<OrderSpecifier<?>> orderBy) |
protected Predicate |
createFilter(QueryMetadata metadata) |
protected Predicate |
createJoinFilter(QueryMetadata metadata) |
MongodbQuery<K> |
distinct() |
boolean |
exists() |
protected abstract com.mongodb.DBCollection |
getCollection(Class<?> type) |
protected List<Object> |
getIds(Class<?> targetType,
Predicate condition) |
com.mysema.commons.lang.CloseableIterator<K> |
iterate() |
com.mysema.commons.lang.CloseableIterator<K> |
iterate(Path<?>... paths) |
<T> JoinBuilder<K,T> |
join(CollectionPathBase<?,T,?> ref,
Path<T> target)
Define a join
|
<T> JoinBuilder<K,T> |
join(Path<T> ref,
Path<T> target)
Define a join
|
MongodbQuery<K> |
limit(long limit) |
List<K> |
list() |
List<K> |
list(Path<?>... paths) |
SearchResults<K> |
listResults() |
SearchResults<K> |
listResults(Path<?>... paths) |
boolean |
notExists() |
MongodbQuery<K> |
offset(long offset) |
MongodbQuery<K> |
orderBy(OrderSpecifier<?>... o) |
MongodbQuery<K> |
orderBy(OrderSpecifier<?> o) |
MongodbQuery<K> |
restrict(QueryModifiers modifiers) |
<T> MongodbQuery<K> |
set(ParamExpression<T> param,
T value) |
void |
setReadPreference(com.mongodb.ReadPreference readPreference) |
K |
singleResult() |
K |
singleResult(Path<?>... paths) |
String |
toString() |
K |
uniqueResult() |
K |
uniqueResult(Path<?>... paths) |
MongodbQuery<K> |
where(Predicate... e) |
MongodbQuery<K> |
where(Predicate e) |
public MongodbQuery(com.mongodb.DBCollection collection,
com.google.common.base.Function<com.mongodb.DBObject,K> transformer,
MongodbSerializer serializer)
collection - transformer - serializer - public <T> JoinBuilder<K,T> join(Path<T> ref, Path<T> target)
ref - target - public <T> JoinBuilder<K,T> join(CollectionPathBase<?,T,?> ref, Path<T> target)
ref - target - public <T> AnyEmbeddedBuilder<K> anyEmbedded(Path<? extends Collection<T>> collection, Path<T> target)
collection - target - protected abstract com.mongodb.DBCollection getCollection(Class<?> type)
public boolean exists()
exists in interface SimpleProjectable<K>@Nullable protected Predicate createFilter(QueryMetadata metadata)
@Nullable protected Predicate createJoinFilter(QueryMetadata metadata)
public boolean notExists()
notExists in interface SimpleProjectable<K>public MongodbQuery<K> distinct()
distinct in interface SimpleQuery<MongodbQuery<K>>public MongodbQuery<K> where(Predicate e)
public MongodbQuery<K> where(Predicate... e)
where in interface FilteredClause<MongodbQuery<K>>public MongodbQuery<K> limit(long limit)
limit in interface SimpleQuery<MongodbQuery<K>>public MongodbQuery<K> offset(long offset)
offset in interface SimpleQuery<MongodbQuery<K>>public MongodbQuery<K> restrict(QueryModifiers modifiers)
restrict in interface SimpleQuery<MongodbQuery<K>>public MongodbQuery<K> orderBy(OrderSpecifier<?> o)
public MongodbQuery<K> orderBy(OrderSpecifier<?>... o)
orderBy in interface SimpleQuery<MongodbQuery<K>>public <T> MongodbQuery<K> set(ParamExpression<T> param, T value)
set in interface SimpleQuery<MongodbQuery<K>>public com.mysema.commons.lang.CloseableIterator<K> iterate()
iterate in interface SimpleProjectable<K>public List<K> list()
list in interface SimpleProjectable<K>protected com.mongodb.DBCursor createCursor()
protected com.mongodb.DBCursor createCursor(com.mongodb.DBCollection collection,
@Nullable
Predicate where,
List<Expression<?>> projection,
QueryModifiers modifiers,
List<OrderSpecifier<?>> orderBy)
public K singleResult()
singleResult in interface SimpleProjectable<K>public K uniqueResult()
uniqueResult in interface SimpleProjectable<K>public SearchResults<K> listResults(Path<?>... paths)
public SearchResults<K> listResults()
listResults in interface SimpleProjectable<K>public long count()
count in interface SimpleProjectable<K>public void setReadPreference(com.mongodb.ReadPreference readPreference)
Copyright © 2007–2014 Mysema Ltd. All rights reserved.