Q
- concrete subtypepublic abstract class AbstractMongodbQuery<Q extends AbstractMongodbQuery<Q>> extends java.lang.Object implements SimpleQuery<Q>
AbstractMongodbQuery
provides a base class for general Querydsl query implementation.Constructor and Description |
---|
AbstractMongodbQuery(MongodbDocumentSerializer serializer)
Create a new MongodbQuery instance
|
Modifier and Type | Method and Description |
---|---|
<T> AnyEmbeddedBuilder<Q> |
anyEmbedded(Path<? extends java.util.Collection<T>> collection,
Path<T> target)
Define a constraint for an embedded object
|
org.bson.Document |
asDocument()
Get the where definition as a Document instance
|
protected @Nullable Predicate |
createFilter(QueryMetadata metadata) |
protected @Nullable Predicate |
createJoinFilter(QueryMetadata metadata) |
protected org.bson.Document |
createProjection(Expression<?> projection) |
protected org.bson.Document |
createQuery(@Nullable Predicate predicate) |
Q |
distinct()
Set the Query to return distinct results
|
protected abstract java.util.List<java.lang.Object> |
getIds(java.lang.Class<?> targetType,
Predicate condition) |
protected QueryMixin<Q> |
getQueryMixin() |
protected com.mongodb.ReadPreference |
getReadPreference() |
protected MongodbDocumentSerializer |
getSerializer() |
<T> JoinBuilder<Q,T> |
join(CollectionPathBase<?,T,?> ref,
Path<T> target)
Define a join
|
<T> JoinBuilder<Q,T> |
join(Path<T> ref,
Path<T> target)
Define a join
|
Q |
limit(long limit)
Set the limit / max results for the query results
|
Q |
offset(long offset)
Set the offset for the query results
|
Q |
orderBy(OrderSpecifier<?>... o)
Add order expressions
|
Q |
orderBy(OrderSpecifier<?> o) |
Q |
restrict(QueryModifiers modifiers)
Set both limit and offset of the query results
|
<T> Q |
set(ParamExpression<T> param,
T value)
Set the given parameter to the given value
|
void |
setReadPreference(com.mongodb.ReadPreference readPreference)
Sets the read preference for this query
|
java.lang.String |
toString() |
Q |
where(Predicate... e)
Adds the given filter conditions
|
Q |
where(Predicate e) |
public AbstractMongodbQuery(MongodbDocumentSerializer serializer)
serializer
- serializerpublic <T> JoinBuilder<Q,T> join(Path<T> ref, Path<T> target)
ref
- referencetarget
- join targetpublic <T> JoinBuilder<Q,T> join(CollectionPathBase<?,T,?> ref, Path<T> target)
ref
- referencetarget
- join targetpublic <T> AnyEmbeddedBuilder<Q> anyEmbedded(Path<? extends java.util.Collection<T>> collection, Path<T> target)
collection
- collectiontarget
- target@Nullable protected @Nullable Predicate createFilter(QueryMetadata metadata)
@Nullable protected @Nullable Predicate createJoinFilter(QueryMetadata metadata)
protected abstract java.util.List<java.lang.Object> getIds(java.lang.Class<?> targetType, Predicate condition)
public Q distinct()
SimpleQuery
distinct
in interface SimpleQuery<Q extends AbstractMongodbQuery<Q>>
public Q where(Predicate... e)
FilteredClause
Skips null arguments
where
in interface FilteredClause<Q extends AbstractMongodbQuery<Q>>
e
- filter conditions to be addedpublic Q limit(long limit)
SimpleQuery
limit
in interface SimpleQuery<Q extends AbstractMongodbQuery<Q>>
limit
- max rowspublic Q offset(long offset)
SimpleQuery
offset
in interface SimpleQuery<Q extends AbstractMongodbQuery<Q>>
offset
- row offsetpublic Q restrict(QueryModifiers modifiers)
SimpleQuery
restrict
in interface SimpleQuery<Q extends AbstractMongodbQuery<Q>>
modifiers
- query modifierspublic Q orderBy(OrderSpecifier<?> o)
public Q orderBy(OrderSpecifier<?>... o)
SimpleQuery
orderBy
in interface SimpleQuery<Q extends AbstractMongodbQuery<Q>>
o
- orderpublic <T> Q set(ParamExpression<T> param, T value)
SimpleQuery
set
in interface SimpleQuery<Q extends AbstractMongodbQuery<Q>>
param
- paramvalue
- bindingprotected org.bson.Document createProjection(Expression<?> projection)
protected org.bson.Document createQuery(@Nullable @Nullable Predicate predicate)
public void setReadPreference(com.mongodb.ReadPreference readPreference)
readPreference
- read preferenceprotected QueryMixin<Q> getQueryMixin()
protected MongodbDocumentSerializer getSerializer()
protected com.mongodb.ReadPreference getReadPreference()
public org.bson.Document asDocument()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007–2021 Querydsl. All rights reserved.