K - result typeQ - concrete subtypepublic 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.| Constructor and 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
|
| Modifier and Type | Method and 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 fields
|
long |
fetchCount() |
K |
fetchFirst() |
K |
fetchFirst(Path<?>... paths)
Fetch first with the specific fields
|
K |
fetchOne() |
K |
fetchOne(Path<?>... paths)
Fetch one with the specific fields
|
QueryResults<K> |
fetchResults() |
QueryResults<K> |
fetchResults(Path<?>... paths)
Fetch results with the specific fields
|
protected 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
|
anyEmbedded, asDocument, createFilter, createJoinFilter, createProjection, createQuery, distinct, getQueryMixin, getReadPreference, getSerializer, join, join, limit, offset, orderBy, orderBy, restrict, set, setReadPreference, toString, where, wherepublic AbstractFetchableMongodbQuery(com.mongodb.client.MongoCollection<org.bson.Document> collection,
java.util.function.Function<org.bson.Document,K> transformer,
MongodbDocumentSerializer serializer)
collection - transformer - result transformerserializer - serializerpublic com.mysema.commons.lang.CloseableIterator<K> iterate(Path<?>... paths)
paths - fields to returnpublic com.mysema.commons.lang.CloseableIterator<K> iterate()
public java.util.List<K> fetch(Path<?>... paths)
paths - fields to returnpublic K fetchFirst(Path<?>... paths)
paths - fields to returnpublic K fetchFirst()
fetchFirst in interface Fetchable<K>public K fetchOne(Path<?>... paths)
paths - fields to returnpublic QueryResults<K> fetchResults(Path<?>... paths)
paths - fields to returnpublic QueryResults<K> fetchResults()
fetchResults in interface Fetchable<K>public long fetchCount()
fetchCount in interface Fetchable<K>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
@Nullable Predicate where,
Expression<?> projection,
QueryModifiers modifiers,
java.util.List<OrderSpecifier<?>> orderBy)
protected 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)
getIds in class AbstractMongodbQuery<Q extends AbstractFetchableMongodbQuery<K,Q>>Copyright © 2007–2021 Querydsl. All rights reserved.