|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.data.document.mongodb.repository.SimpleMongoRepository<T,ID>
org.springframework.data.document.mongodb.repository.QueryDslMongoRepository<T,ID>
public class QueryDslMongoRepository<T,ID extends java.io.Serializable>
Special QueryDsl based repository implementation that allows execution Predicate
s in various forms. TODO:
Extract EntityPathResolver
into Spring Data Commons TODO: Refactor Spring Data JPA to use this common
infrastructure
Nested Class Summary | |
---|---|
private class |
QueryDslMongoRepository.MongoConverterTransformer
QueryDslMongoRepository.MongoConverterTransformer implementation to delegate to a MongoConverter . |
private class |
QueryDslMongoRepository.MongoTemplateQuery
Special MongodbQuery implementation to use our MongoOperations for actually accessing Mongo. |
Field Summary | |
---|---|
private |
builder
|
private MongodbSerializer |
serializer
|
private QueryDslMongoRepository.MongoConverterTransformer |
transformer
|
Constructor Summary | |
---|---|
QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation,
MongoTemplate template)
Creates a new QueryDslMongoRepository for the given EntityMetadata and MongoTemplate . |
|
QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation,
MongoTemplate template,
EntityPathResolver resolver)
Creates a new QueryDslMongoRepository for the given MongoEntityInformation , MongoTemplate
and EntityPathResolver . |
Method Summary | |
---|---|
private |
applyPagination(
Applies the given Pageable to the given MongodbQuery . |
private |
applySorting(
Applies the given Sort to the given MongodbQuery . |
long |
count(Predicate predicate)
|
private |
createQueryFor(Predicate predicate)
Creates a MongodbQuery for the given Predicate . |
java.util.List<T> |
findAll(Predicate predicate)
|
java.util.List<T> |
findAll(Predicate predicate,
|
|
findAll(Predicate predicate,
Pageable pageable)
|
T |
findOne(Predicate predicate)
|
private |
toOrder(Order order)
Transforms a plain Order into a QueryDsl specific OrderSpecifier . |
Methods inherited from class org.springframework.data.document.mongodb.repository.SimpleMongoRepository |
---|
count, delete, delete, delete, deleteAll, exists, findAll, getEntityInformation, getMongoOperations, save, save |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final QueryDslMongoRepository.MongoConverterTransformer transformer
private final MongodbSerializer serializer
private finalbuilder
Constructor Detail |
---|
public QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation, MongoTemplate template)
QueryDslMongoRepository
for the given EntityMetadata
and MongoTemplate
. Uses
the SimpleEntityPathResolver
to create an EntityPath
for the given domain class.
entityInformation
- template
- public QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation, MongoTemplate template, EntityPathResolver resolver)
QueryDslMongoRepository
for the given MongoEntityInformation
, MongoTemplate
and EntityPathResolver
.
entityInformation
- template
- resolver
- Method Detail |
---|
public T findOne(Predicate predicate)
findOne
in class SimpleMongoRepository<T,ID extends java.io.Serializable>
public java.util.List<T> findAll(Predicate predicate)
findAll
in class SimpleMongoRepository<T,ID extends java.io.Serializable>
public java.util.List<T> findAll(Predicate predicate,... orders)
publicfindAll(Predicate predicate, Pageable pageable)
public long count(Predicate predicate)
privatecreateQueryFor(Predicate predicate)
MongodbQuery
for the given Predicate
.
predicate
-
privateapplyPagination( query, Pageable pageable)
Pageable
to the given MongodbQuery
.
query
- pageable
-
privateapplySorting( query, Sort sort)
Sort
to the given MongodbQuery
.
query
- sort
-
privatetoOrder(Order order)
Order
into a QueryDsl specific OrderSpecifier
.
order
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |