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>
FetchableMongodb query with a pluggable Document to Bean transformation.- Author:
- Mark Paluch
-
-
Constructor Summary
Constructors Constructor Description AbstractFetchableMongodbQuery(com.mongodb.client.MongoCollection<org.bson.Document> collection, java.util.function.Function<org.bson.Document,K> transformer, MongodbDocumentSerializer serializer)Create a new MongodbQuery instance
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected com.mongodb.client.FindIterable<org.bson.Document>createCursor()protected com.mongodb.client.FindIterable<org.bson.Document>createCursor(com.mongodb.client.MongoCollection<org.bson.Document> collection, @Nullable Predicate where, Expression<?> projection, QueryModifiers modifiers, java.util.List<OrderSpecifier<?>> orderBy)java.util.List<K>fetch()java.util.List<K>fetch(Path<?>... paths)Fetch with the specific fieldslongfetchCount()KfetchFirst()KfetchFirst(Path<?>... paths)Fetch first with the specific fieldsKfetchOne()KfetchOne(Path<?>... paths)Fetch one with the specific fieldsQueryResults<K>fetchResults()QueryResults<K>fetchResults(Path<?>... paths)Fetch results with the specific fieldsprotected abstract com.mongodb.client.MongoCollection<org.bson.Document>getCollection(java.lang.Class<?> type)protected java.util.List<java.lang.Object>getIds(java.lang.Class<?> targetType, Predicate condition)com.mysema.commons.lang.CloseableIterator<K>iterate()com.mysema.commons.lang.CloseableIterator<K>iterate(Path<?>... paths)Iterate with the specific fields-
Methods 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 Detail
-
AbstractFetchableMongodbQuery
public AbstractFetchableMongodbQuery(com.mongodb.client.MongoCollection<org.bson.Document> collection, java.util.function.Function<org.bson.Document,K> transformer, MongodbDocumentSerializer serializer)Create a new MongodbQuery instance- Parameters:
collection-transformer- result transformerserializer- serializer
-
-
Method Detail
-
iterate
public com.mysema.commons.lang.CloseableIterator<K> iterate(Path<?>... paths)
Iterate with the specific fields- Parameters:
paths- fields to return- Returns:
- iterator
-
iterate
public com.mysema.commons.lang.CloseableIterator<K> iterate()
-
fetch
public java.util.List<K> fetch(Path<?>... paths)
Fetch with the specific fields- Parameters:
paths- fields to return- Returns:
- results
-
fetchFirst
public K fetchFirst(Path<?>... paths)
Fetch first with the specific fields- Parameters:
paths- fields to return- Returns:
- first result
-
fetchFirst
public K fetchFirst()
- Specified by:
fetchFirstin interfaceFetchable<K>
-
fetchOne
public K fetchOne(Path<?>... paths)
Fetch one with the specific fields- Parameters:
paths- fields to return- Returns:
- first result
-
fetchResults
public QueryResults<K> fetchResults(Path<?>... paths)
Fetch results with the specific fields- Parameters:
paths- fields to return- Returns:
- results
-
fetchResults
public QueryResults<K> 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, java.util.List<OrderSpecifier<?>> orderBy)
-
getCollection
protected abstract com.mongodb.client.MongoCollection<org.bson.Document> getCollection(java.lang.Class<?> type)
-
getIds
protected java.util.List<java.lang.Object> getIds(java.lang.Class<?> targetType, Predicate condition)- Specified by:
getIdsin classAbstractMongodbQuery<Q extends AbstractFetchableMongodbQuery<K,Q>>
-
-