Q - concrete subtypepublic abstract class QuerydslAbstractMongodbQuery<K,Q extends QuerydslAbstractMongodbQuery<K,Q>> extends Object implements com.querydsl.core.SimpleQuery<Q>
QuerydslAbstractMongodbQuery provides a base class for general Querydsl query implementation.
Original implementation source AbstractMongodbQuery by The Querydsl Team
(http://www.querydsl.com/team) licensed under the Apache License, Version
2.0.
MongodbDocumentSerializer.| Modifier and Type | Method and Description |
|---|---|
protected org.bson.Document |
createProjection(com.querydsl.core.types.Expression<?> projectionExpression)
Compute the actual projection
Document from a given projectionExpression by serializing the contained
expressions individually. |
protected org.bson.Document |
createQuery(com.querydsl.core.types.Predicate predicate)
Compute the filer
Document from the given Predicate. |
protected org.bson.Document |
createSort(List<com.querydsl.core.types.OrderSpecifier<?>> orderSpecifiers)
Compute the sort
Document from the given list of order specifiers. |
Q |
distinct() |
Q |
limit(long limit) |
Q |
offset(long offset) |
Q |
orderBy(com.querydsl.core.types.OrderSpecifier<?>... o) |
Q |
restrict(com.querydsl.core.QueryModifiers modifiers) |
<T> Q |
set(com.querydsl.core.types.ParamExpression<T> param,
T value) |
String |
toJson()
Obtain the Mongo Shell json query representation.
|
String |
toJson(org.bson.json.JsonWriterSettings settings)
Obtain the json query representation applying given
settings. |
String |
toString()
Returns the Mongo Shell representation of the query.
|
Q |
where(com.querydsl.core.types.Predicate... e) |
public Q distinct()
distinct in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>public Q where(com.querydsl.core.types.Predicate... e)
where in interface com.querydsl.core.FilteredClause<Q extends QuerydslAbstractMongodbQuery<K,Q>>public Q limit(long limit)
limit in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>public Q offset(long offset)
offset in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>public Q restrict(com.querydsl.core.QueryModifiers modifiers)
restrict in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>public Q orderBy(com.querydsl.core.types.OrderSpecifier<?>... o)
orderBy in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>public <T> Q set(com.querydsl.core.types.ParamExpression<T> param, T value)
set in interface com.querydsl.core.SimpleQuery<Q extends QuerydslAbstractMongodbQuery<K,Q>>protected org.bson.Document createProjection(@Nullable com.querydsl.core.types.Expression<?> projectionExpression)
Document from a given projectionExpression by serializing the contained
expressions individually.projectionExpression - the computed projection Document.Document by default.MongodbDocumentSerializer.handle(Expression)protected org.bson.Document createQuery(@Nullable com.querydsl.core.types.Predicate predicate)
Document from the given Predicate.predicate - can be null.Document if predicate is null.MongodbDocumentSerializer.toQuery(Predicate)protected org.bson.Document createSort(List<com.querydsl.core.types.OrderSpecifier<?>> orderSpecifiers)
Document from the given list of order specifiers.orderSpecifiers - can be null.Document if predicate is null.MongodbDocumentSerializer.toSort(List)public String toString()
where(p.lastname.eq("Matthews")).orderBy(p.firstname.asc()).offset(1).limit(5);
results in
find({"lastname" : "Matthews"}).sort({"firstname" : 1}).skip(1).limit(5)
Note that encoding to String may fail when using data types that cannot be encoded or DBRef's without an
identifier.public String toJson()
public String toJson(org.bson.json.JsonWriterSettings settings)
settings.settings - must not be null.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.