public class SimpleMongoRepository<T,ID> extends Object implements MongoRepository<T,ID>
Constructor and Description |
---|
SimpleMongoRepository(MongoEntityInformation<T,ID> metadata,
MongoOperations mongoOperations)
|
Modifier and Type | Method and Description |
---|---|
long |
count() |
<S extends T> |
count(Example<S> example) |
void |
delete(T entity) |
void |
deleteAll() |
void |
deleteAll(Iterable<? extends T> entities) |
void |
deleteById(ID id) |
<S extends T> |
exists(Example<S> example) |
boolean |
existsById(ID id) |
List<T> |
findAll() |
<S extends T> |
findAll(Example<S> example) |
<S extends T> |
findAll(Example<S> example,
Pageable pageable) |
<S extends T> |
findAll(Example<S> example,
Sort sort) |
Page<T> |
findAll(Pageable pageable) |
List<T> |
findAll(Sort sort) |
Iterable<T> |
findAllById(Iterable<ID> ids) |
Optional<T> |
findById(ID id) |
<S extends T> |
findOne(Example<S> example) |
<S extends T> |
insert(Iterable<S> entities)
Inserts the given entities.
|
<S extends T> |
insert(S entity)
Inserts the given entity.
|
<S extends T> |
save(S entity) |
<S extends T> |
saveAll(Iterable<S> entities) |
public SimpleMongoRepository(MongoEntityInformation<T,ID> metadata, MongoOperations mongoOperations)
metadata
- must not be null.mongoOperations
- must not be null.public <S extends T> S save(S entity)
save
in interface CrudRepository<T,ID>
public <S extends T> List<S> saveAll(Iterable<S> entities)
saveAll
in interface MongoRepository<T,ID>
saveAll
in interface CrudRepository<T,ID>
public Optional<T> findById(ID id)
findById
in interface CrudRepository<T,ID>
public boolean existsById(ID id)
existsById
in interface CrudRepository<T,ID>
public long count()
count
in interface CrudRepository<T,ID>
public void deleteById(ID id)
deleteById
in interface CrudRepository<T,ID>
public void delete(T entity)
delete
in interface CrudRepository<T,ID>
public void deleteAll(Iterable<? extends T> entities)
deleteAll
in interface CrudRepository<T,ID>
public void deleteAll()
deleteAll
in interface CrudRepository<T,ID>
public List<T> findAll()
findAll
in interface MongoRepository<T,ID>
findAll
in interface CrudRepository<T,ID>
public Iterable<T> findAllById(Iterable<ID> ids)
findAllById
in interface CrudRepository<T,ID>
public Page<T> findAll(Pageable pageable)
findAll
in interface PagingAndSortingRepository<T,ID>
public List<T> findAll(Sort sort)
findAll
in interface MongoRepository<T,ID>
findAll
in interface PagingAndSortingRepository<T,ID>
public <S extends T> S insert(S entity)
MongoRepository
CrudRepository.save(Object)
instead to avoid the usage of store-specific API.insert
in interface MongoRepository<T,ID>
entity
- must not be null.public <S extends T> List<S> insert(Iterable<S> entities)
MongoRepository
MongoRepository.saveAll(Iterable)
. Prefer using MongoRepository.saveAll(Iterable)
to avoid the usage of store
specific API.insert
in interface MongoRepository<T,ID>
entities
- must not be null.public <S extends T> Page<S> findAll(Example<S> example, Pageable pageable)
findAll
in interface QueryByExampleExecutor<T>
public <S extends T> List<S> findAll(Example<S> example, Sort sort)
findAll
in interface MongoRepository<T,ID>
findAll
in interface QueryByExampleExecutor<T>
public <S extends T> List<S> findAll(Example<S> example)
findAll
in interface MongoRepository<T,ID>
findAll
in interface QueryByExampleExecutor<T>
public <S extends T> Optional<S> findOne(Example<S> example)
findOne
in interface QueryByExampleExecutor<T>
public <S extends T> long count(Example<S> example)
count
in interface QueryByExampleExecutor<T>
public <S extends T> boolean exists(Example<S> example)
exists
in interface QueryByExampleExecutor<T>
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.