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 |
deleteAllById(Iterable<? extends ID> ids) |
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)
Returns all entities matching the given
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) |
<S extends T,R> |
findBy(Example<S> example,
Function<FluentQuery.FetchableFluentQuery<S>,R> queryFunction) |
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 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 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 deleteAllById(Iterable<? extends ID> ids)
deleteAllById 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 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)
MongoRepositoryCrudRepository.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)
MongoRepositoryMongoRepository.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> Optional<S> findOne(Example<S> example)
findOne in interface QueryByExampleExecutor<T>public <S extends T> List<S> findAll(Example<S> example)
MongoRepositoryExample. In case no match could be found an empty List is
returned. Example uses typed matching restricting it to probe assignable types. For example, when
sticking with the default type key (_class), the query has restrictions such as
_class : { $in : [com.acme.Person] }. UntypedExampleMatcher with
Example.of(Object, org.springframework.data.domain.ExampleMatcher).findAll in interface MongoRepository<T,ID>findAll in interface QueryByExampleExecutor<T>QueryByExampleExecutor.findAll(org.springframework.data.domain.Example)public <S extends T> List<S> findAll(Example<S> example, Sort sort)
MongoRepositoryExample applying the given Sort. In case no match could be
found an empty List is returned. Example uses typed matching restricting it to probe assignable types. For example, when
sticking with the default type key (_class), the query has restrictions such as
_class : { $in : [com.acme.Person] }. UntypedExampleMatcher with
Example.of(Object, org.springframework.data.domain.ExampleMatcher).findAll in interface MongoRepository<T,ID>findAll in interface QueryByExampleExecutor<T>QueryByExampleExecutor.findAll(org.springframework.data.domain.Example,
org.springframework.data.domain.Sort)public <S extends T> Page<S> findAll(Example<S> example, Pageable pageable)
findAll 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>public <S extends T,R> R findBy(Example<S> example, Function<FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
findBy in interface QueryByExampleExecutor<T>Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.