|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mysema.query.mongodb.MongodbQuery<K>
K
- public abstract class MongodbQuery<K>
MongodbQuery provides a general Querydsl query implementation with a pluugable DBObject to Bean transformation
Constructor Summary | |
---|---|
MongodbQuery(com.mongodb.DBCollection collection,
com.google.common.base.Function<com.mongodb.DBObject,K> transformer,
MongodbSerializer serializer)
|
Method Summary | ||
---|---|---|
|
anyEmbedded(Path<? extends Collection<T>> collection,
Path<T> target)
|
|
long |
count()
Get the count of matched elements |
|
long |
countDistinct()
Get the count of distinct matched elements |
|
protected com.mongodb.DBCursor |
createCursor()
|
|
protected com.mongodb.DBCursor |
createCursor(com.mongodb.DBCollection collection,
Predicate where,
QueryModifiers modifiers,
List<OrderSpecifier<?>> orderBy)
|
|
protected Predicate |
createFilter(QueryMetadata metadata)
|
|
protected Predicate |
createJoinFilter(QueryMetadata metadata)
|
|
MongodbQuery<K> |
distinct()
Set the Query to return distinct results |
|
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()
Get the projection as a typed closeable Iterator |
|
com.mysema.commons.lang.CloseableIterator<K> |
iterateDistinct()
Get the projection as a typed closeable Iterator with distinct elements |
|
|
join(Path<T> ref,
Path<T> target)
|
|
MongodbQuery<K> |
limit(long limit)
Defines the limit / max results for the query results |
|
List<K> |
list()
Get the projection as a typed List |
|
List<K> |
listDistinct()
Get the projection as a typed List with distinct elements |
|
SearchResults<K> |
listDistinctResults()
Get the projection in SearchResults form with distinct element |
|
SearchResults<K> |
listResults()
Get the projection in SearchResults form |
|
boolean |
notExists()
|
|
MongodbQuery<K> |
offset(long offset)
Defines the offset for the query results |
|
MongodbQuery<K> |
orderBy(OrderSpecifier<?>... o)
Defines the order expressions |
|
MongodbQuery<K> |
restrict(QueryModifiers modifiers)
Defines both limit and offset of the query results |
|
|
set(ParamExpression<T> param,
T value)
Set the given parameter to the given value |
|
K |
singleResult()
Get the projection as a single result or null if no result is found |
|
String |
toString()
|
|
K |
uniqueResult()
Get the projection as a unique result or null if no result is found |
|
MongodbQuery<K> |
where(Predicate... e)
Adds the given filter conditions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MongodbQuery(com.mongodb.DBCollection collection, com.google.common.base.Function<com.mongodb.DBObject,K> transformer, MongodbSerializer serializer)
Method Detail |
---|
public <T> JoinBuilder<K,T> join(Path<T> ref, Path<T> target)
public <T> AnyEmbeddedBuilder<K> anyEmbedded(Path<? extends Collection<T>> collection, Path<T> 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)
protected List<Object> getIds(Class<?> targetType, Predicate condition)
public boolean notExists()
notExists
in interface SimpleProjectable<K>
public MongodbQuery<K> distinct()
SimpleQuery
distinct
in interface SimpleQuery<MongodbQuery<K>>
public MongodbQuery<K> where(Predicate... e)
FilteredClause
where
in interface FilteredClause<MongodbQuery<K>>
e
- filter conditions to be added
public MongodbQuery<K> limit(long limit)
SimpleQuery
limit
in interface SimpleQuery<MongodbQuery<K>>
public MongodbQuery<K> offset(long offset)
SimpleQuery
offset
in interface SimpleQuery<MongodbQuery<K>>
public MongodbQuery<K> restrict(QueryModifiers modifiers)
SimpleQuery
restrict
in interface SimpleQuery<MongodbQuery<K>>
public MongodbQuery<K> orderBy(OrderSpecifier<?>... o)
SimpleQuery
orderBy
in interface SimpleQuery<MongodbQuery<K>>
public <T> MongodbQuery<K> set(ParamExpression<T> param, T value)
SimpleQuery
set
in interface SimpleQuery<MongodbQuery<K>>
public com.mysema.commons.lang.CloseableIterator<K> iterate()
SimpleProjectable
iterate
in interface SimpleProjectable<K>
public com.mysema.commons.lang.CloseableIterator<K> iterateDistinct()
SimpleProjectable
iterateDistinct
in interface SimpleProjectable<K>
public List<K> list()
SimpleProjectable
list
in interface SimpleProjectable<K>
protected com.mongodb.DBCursor createCursor()
protected com.mongodb.DBCursor createCursor(com.mongodb.DBCollection collection, @Nullable Predicate where, QueryModifiers modifiers, List<OrderSpecifier<?>> orderBy)
public List<K> listDistinct()
SimpleProjectable
listDistinct
in interface SimpleProjectable<K>
public K singleResult()
SimpleProjectable
for multiple results only the first one is returned
singleResult
in interface SimpleProjectable<K>
public K uniqueResult()
SimpleProjectable
uniqueResult
in interface SimpleProjectable<K>
public SearchResults<K> listResults()
SimpleProjectable
SearchResults
form
listResults
in interface SimpleProjectable<K>
public SearchResults<K> listDistinctResults()
SimpleProjectable
SearchResults
form with distinct element
listDistinctResults
in interface SimpleProjectable<K>
public long count()
SimpleProjectable
count
in interface SimpleProjectable<K>
public long countDistinct()
SimpleProjectable
countDistinct
in interface SimpleProjectable<K>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |