org.springframework.data.mongodb.repository.support
Class SimpleMongoRepository<T,ID extends Serializable>
java.lang.Object
org.springframework.data.mongodb.repository.support.SimpleMongoRepository<T,ID>
- All Implemented Interfaces:
- MongoRepository<T,ID>, CrudRepository<T,ID>, PagingAndSortingRepository<T,ID>, Repository<T,ID>
- Direct Known Subclasses:
- QueryDslMongoRepository
public class SimpleMongoRepository<T,ID extends Serializable>
- extends Object
- implements MongoRepository<T,ID>
Repository base implementation for Mongo.
- Author:
- Oliver Gierke
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleMongoRepository
public SimpleMongoRepository(MongoEntityInformation<T,ID> metadata,
MongoOperations mongoOperations)
- Creates a ew
SimpleMongoRepository for the given MongoEntityInformation and MongoTemplate.
- Parameters:
metadata - template -
save
public <S extends T> S save(S entity)
- Specified by:
save in interface CrudRepository<T,ID extends Serializable>
save
public <S extends T> List<S> save(Iterable<S> entities)
- Specified by:
save in interface MongoRepository<T,ID extends Serializable>- Specified by:
save in interface CrudRepository<T,ID extends Serializable>
findOne
public T findOne(ID id)
- Specified by:
findOne in interface CrudRepository<T,ID extends Serializable>
exists
public boolean exists(ID id)
- Specified by:
exists in interface CrudRepository<T,ID extends Serializable>
count
public long count()
- Specified by:
count in interface CrudRepository<T,ID extends Serializable>
delete
public void delete(ID id)
- Specified by:
delete in interface CrudRepository<T,ID extends Serializable>
delete
public void delete(T entity)
- Specified by:
delete in interface CrudRepository<T,ID extends Serializable>
delete
public void delete(Iterable<? extends T> entities)
- Specified by:
delete in interface CrudRepository<T,ID extends Serializable>
deleteAll
public void deleteAll()
- Specified by:
deleteAll in interface CrudRepository<T,ID extends Serializable>
findAll
public List<T> findAll()
- Specified by:
findAll in interface MongoRepository<T,ID extends Serializable>- Specified by:
findAll in interface CrudRepository<T,ID extends Serializable>
findAll
public Iterable<T> findAll(Iterable<ID> ids)
- Specified by:
findAll in interface CrudRepository<T,ID extends Serializable>
findAll
public Page<T> findAll(Pageable pageable)
- Specified by:
findAll in interface PagingAndSortingRepository<T,ID extends Serializable>
findAll
public List<T> findAll(Sort sort)
- Specified by:
findAll in interface MongoRepository<T,ID extends Serializable>- Specified by:
findAll in interface PagingAndSortingRepository<T,ID extends Serializable>
getMongoOperations
protected MongoOperations getMongoOperations()
- Returns the underlying
MongoOperations instance.
- Returns:
getEntityInformation
protected MongoEntityInformation<T,ID> getEntityInformation()
- Returns:
- the entityInformation
Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.