org.springframework.data.document.mongodb.repository
Class SimpleMongoRepository<T,ID extends Serializable>
java.lang.Object
org.springframework.data.repository.support.RepositorySupport<T,ID>
org.springframework.data.document.mongodb.repository.SimpleMongoRepository<T,ID>
- All Implemented Interfaces:
- org.springframework.data.repository.PagingAndSortingRepository<T,ID>, org.springframework.data.repository.Repository<T,ID>
public class SimpleMongoRepository<T,ID extends Serializable>
- extends org.springframework.data.repository.support.RepositorySupport<T,ID>
- implements org.springframework.data.repository.PagingAndSortingRepository<T,ID>
Repository base implementation for Mongo.
- Author:
- Oliver Gierke
Methods inherited from class org.springframework.data.repository.support.RepositorySupport |
getDomainClass, getIsNewStrategy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleMongoRepository
public SimpleMongoRepository(Class<T> domainClass,
MongoTemplate template)
- Creates a ew
SimpleMongoRepository
for the given domain class and
MongoTemplate
.
- Parameters:
domainClass
- template
-
save
public T save(T entity)
- Specified by:
save
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
save
public List<T> save(Iterable<? extends T> entities)
- Specified by:
save
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
findById
public T findById(ID id)
- Specified by:
findById
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
exists
public boolean exists(ID id)
- Specified by:
exists
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
findAll
public List<T> findAll()
- Specified by:
findAll
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
count
public Long count()
- Specified by:
count
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
delete
public void delete(T entity)
- Specified by:
delete
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
delete
public void delete(Iterable<? extends T> entities)
- Specified by:
delete
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
deleteAll
public void deleteAll()
- Specified by:
deleteAll
in interface org.springframework.data.repository.Repository<T,ID extends Serializable>
findAll
public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
- Specified by:
findAll
in interface org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>
findAll
public List<T> findAll(org.springframework.data.domain.Sort sort)
- Specified by:
findAll
in interface org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>
createIsNewStrategy
protected org.springframework.data.repository.support.IsNewAware createIsNewStrategy(Class<?> domainClass)
- Specified by:
createIsNewStrategy
in class org.springframework.data.repository.support.RepositorySupport<T,ID extends Serializable>
Copyright © 2011. All Rights Reserved.