|
|||||||||
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 QueryDslMongoRepository.EntityPathResolver
into Spring Data Commons TODO: Refactor Spring Data JPA to use this common
infrastructure
Nested Class Summary | |
---|---|
static interface |
QueryDslMongoRepository.EntityPathResolver
Strategy interface to abstract the ways to translate an plain domain class into a EntityPath . |
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. |
(package private) static class |
QueryDslMongoRepository.SimpleEntityPathResolver
Simple implementation of QueryDslMongoRepository.EntityPathResolver to lookup a query
class by reflection and using the static field of the same type. |
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,
QueryDslMongoRepository.EntityPathResolver resolver)
Creates a new QueryDslMongoRepository for the given MongoEntityInformation ,
MongoTemplate and QueryDslMongoRepository.EntityPathResolver . |
Method Summary | |
---|---|
private |
applyPagination(
Applies the given Pageable to the given MongodbQuery . |
private |
applySorting(
Applies the given Sort to the given MongodbQuery . |
java.lang.Long |
count(Predicate predicate)
Returns the number of instances that the given Predicate will return. |
private |
createQueryFor(Predicate predicate)
Creates a MongodbQuery for the given Predicate . |
java.util.List<T> |
findAll(Predicate predicate)
Returns all entities matching the given Predicate . |
java.util.List<T> |
findAll(Predicate predicate,
Returns all entities matching the given Predicate applying the given OrderSpecifier s. |
|
findAll(Predicate predicate,
Pageable pageable)
Returns all entities matching the given Predicate applying the given OrderSpecifier s. |
T |
findOne(Predicate predicate)
Returns a single entity matching the given 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, 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
QueryDslMongoRepository.SimpleEntityPathResolver
to create an EntityPath
for the
given domain class.
entityInformation
- template
- public QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation, MongoTemplate template, QueryDslMongoRepository.EntityPathResolver resolver)
QueryDslMongoRepository
for the given MongoEntityInformation
,
MongoTemplate
and QueryDslMongoRepository.EntityPathResolver
.
entityInformation
- template
- resolver
- Method Detail |
---|
public T findOne(Predicate predicate)
QueryDslPredicateExecutor
Predicate
.
findOne
in interface QueryDslPredicateExecutor<T>
findOne
in class SimpleMongoRepository<T,ID extends java.io.Serializable>
public java.util.List<T> findAll(Predicate predicate)
QueryDslPredicateExecutor
Predicate
.
findAll
in interface QueryDslPredicateExecutor<T>
findAll
in class SimpleMongoRepository<T,ID extends java.io.Serializable>
public java.util.List<T> findAll(Predicate predicate,... orders)
QueryDslPredicateExecutor
Predicate
applying the given OrderSpecifier
s.
findAll
in interface QueryDslPredicateExecutor<T>
publicfindAll(Predicate predicate, Pageable pageable)
QueryDslPredicateExecutor
Predicate
applying the given OrderSpecifier
s.
findAll
in interface QueryDslPredicateExecutor<T>
public java.lang.Long count(Predicate predicate)
QueryDslPredicateExecutor
Predicate
will return.
count
in interface QueryDslPredicateExecutor<T>
predicate
- the Predicate
to count instances for
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 |