Spring Data Document

org.springframework.data.mongodb.repository.support
Class QueryDslMongoRepository<T,ID extends Serializable>

java.lang.Object
  extended by org.springframework.data.mongodb.repository.support.SimpleMongoRepository<T,ID>
      extended by org.springframework.data.mongodb.repository.support.QueryDslMongoRepository<T,ID>
All Implemented Interfaces:
org.springframework.data.querydsl.QueryDslPredicateExecutor<T>, org.springframework.data.repository.CrudRepository<T,ID>, org.springframework.data.repository.PagingAndSortingRepository<T,ID>, org.springframework.data.repository.Repository<T,ID>

public class QueryDslMongoRepository<T,ID extends Serializable>
extends SimpleMongoRepository<T,ID>
implements org.springframework.data.querydsl.QueryDslPredicateExecutor<T>

Special QueryDsl based repository implementation that allows execution Predicates in various forms.

Author:
Oliver Gierke

Constructor Summary
QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation, MongoOperations mongoOperations)
          Creates a new QueryDslMongoRepository for the given EntityMetadata and MongoTemplate.
QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation, MongoOperations mongoOperations, org.springframework.data.querydsl.EntityPathResolver resolver)
          Creates a new QueryDslMongoRepository for the given MongoEntityInformation, MongoTemplate and EntityPathResolver.
 
Method Summary
 long count(com.mysema.query.types.Predicate predicate)
           
 List<T> findAll(com.mysema.query.types.Predicate predicate)
           
 List<T> findAll(com.mysema.query.types.Predicate predicate, com.mysema.query.types.OrderSpecifier<?>... orders)
           
 org.springframework.data.domain.Page<T> findAll(com.mysema.query.types.Predicate predicate, org.springframework.data.domain.Pageable pageable)
           
 T findOne(com.mysema.query.types.Predicate predicate)
           
 
Methods inherited from class org.springframework.data.mongodb.repository.support.SimpleMongoRepository
count, delete, delete, delete, deleteAll, exists, findAll, findAll, findAll, findOne, getEntityInformation, getMongoOperations, save, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryDslMongoRepository

public QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation,
                               MongoOperations mongoOperations)
Creates a new QueryDslMongoRepository for the given EntityMetadata and MongoTemplate. Uses the SimpleEntityPathResolver to create an EntityPath for the given domain class.

Parameters:
entityInformation -
template -

QueryDslMongoRepository

public QueryDslMongoRepository(MongoEntityInformation<T,ID> entityInformation,
                               MongoOperations mongoOperations,
                               org.springframework.data.querydsl.EntityPathResolver resolver)
Creates a new QueryDslMongoRepository for the given MongoEntityInformation, MongoTemplate and EntityPathResolver.

Parameters:
entityInformation -
mongoOperations -
resolver -
Method Detail

findOne

public T findOne(com.mysema.query.types.Predicate predicate)
Specified by:
findOne in interface org.springframework.data.querydsl.QueryDslPredicateExecutor<T>

findAll

public List<T> findAll(com.mysema.query.types.Predicate predicate)
Specified by:
findAll in interface org.springframework.data.querydsl.QueryDslPredicateExecutor<T>

findAll

public List<T> findAll(com.mysema.query.types.Predicate predicate,
                       com.mysema.query.types.OrderSpecifier<?>... orders)
Specified by:
findAll in interface org.springframework.data.querydsl.QueryDslPredicateExecutor<T>

findAll

public org.springframework.data.domain.Page<T> findAll(com.mysema.query.types.Predicate predicate,
                                                       org.springframework.data.domain.Pageable pageable)
Specified by:
findAll in interface org.springframework.data.querydsl.QueryDslPredicateExecutor<T>

count

public long count(com.mysema.query.types.Predicate predicate)
Specified by:
count in interface org.springframework.data.querydsl.QueryDslPredicateExecutor<T>

Spring Data Document

Copyright © 2012. All Rights Reserved.