Package com.querydsl.mongodb.document
Class AbstractFetchableMongodbQuery<K,Q extends AbstractFetchableMongodbQuery<K,Q>>
java.lang.Object
com.querydsl.mongodb.document.AbstractMongodbQuery<Q>
com.querydsl.mongodb.document.AbstractFetchableMongodbQuery<K,Q>
- Type Parameters:
K- result typeQ- concrete subtype
- All Implemented Interfaces:
Fetchable<K>,FilteredClause<Q>,SimpleQuery<Q>
public abstract class AbstractFetchableMongodbQuery<K,Q extends AbstractFetchableMongodbQuery<K,Q>>
extends AbstractMongodbQuery<Q>
implements Fetchable<K>
Fetchable Mongodb query with a pluggable Document to Bean transformation.- Author:
- Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractFetchableMongodbQuery(com.mongodb.client.MongoCollection<org.bson.Document> collection, Function<org.bson.Document, K> transformer, MongodbDocumentSerializer serializer) Create a new MongodbQuery instance -
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.client.FindIterable<org.bson.Document>protected com.mongodb.client.FindIterable<org.bson.Document>createCursor(com.mongodb.client.MongoCollection<org.bson.Document> collection, @Nullable Predicate where, Expression<?> projection, QueryModifiers modifiers, List<OrderSpecifier<?>> orderBy) fetch()Fetch with the specific fieldslongfetchFirst(Path<?>... paths) Fetch first with the specific fieldsfetchOne()Fetch one with the specific fieldsfetchResults(Path<?>... paths) Fetch results with the specific fieldsprotected abstract com.mongodb.client.MongoCollection<org.bson.Document>getCollection(Class<?> type) com.mysema.commons.lang.CloseableIterator<K>iterate()com.mysema.commons.lang.CloseableIterator<K>Iterate with the specific fieldsMethods inherited from class com.querydsl.mongodb.document.AbstractMongodbQuery
anyEmbedded, asDocument, createFilter, createJoinFilter, createProjection, createQuery, distinct, getQueryMixin, getReadPreference, getSerializer, join, join, limit, offset, orderBy, orderBy, restrict, set, setReadPreference, toString, where, where
-
Constructor Details
-
AbstractFetchableMongodbQuery
public AbstractFetchableMongodbQuery(com.mongodb.client.MongoCollection<org.bson.Document> collection, Function<org.bson.Document, K> transformer, MongodbDocumentSerializer serializer) Create a new MongodbQuery instance- Parameters:
collection-transformer- result transformerserializer- serializer
-
-
Method Details
-
iterate
Iterate with the specific fields- Parameters:
paths- fields to return- Returns:
- iterator
-
iterate
-
fetch
Fetch with the specific fields- Parameters:
paths- fields to return- Returns:
- results
-
fetch
-
fetchFirst
Fetch first with the specific fields- Parameters:
paths- fields to return- Returns:
- first result
-
fetchFirst
- Specified by:
fetchFirstin interfaceFetchable<K>
-
fetchOne
Fetch one with the specific fields- Parameters:
paths- fields to return- Returns:
- first result
-
fetchOne
-
fetchResults
Fetch results with the specific fields- Parameters:
paths- fields to return- Returns:
- results
-
fetchResults
- Specified by:
fetchResultsin interfaceFetchable<K>
-
fetchCount
public long fetchCount()- Specified by:
fetchCountin interfaceFetchable<K>
-
createCursor
protected com.mongodb.client.FindIterable<org.bson.Document> createCursor() -
createCursor
protected com.mongodb.client.FindIterable<org.bson.Document> createCursor(com.mongodb.client.MongoCollection<org.bson.Document> collection, @Nullable @Nullable Predicate where, Expression<?> projection, QueryModifiers modifiers, List<OrderSpecifier<?>> orderBy) -
getCollection
protected abstract com.mongodb.client.MongoCollection<org.bson.Document> getCollection(Class<?> type) -
getIds
- Specified by:
getIdsin classAbstractMongodbQuery<Q extends AbstractFetchableMongodbQuery<K,Q>>
-