@NoRepositoryBean public interface CrudRepository<T,ID extends Serializable> extends Repository<T,ID>
Modifier and Type | Method and Description |
---|---|
long |
count()
Returns the number of entities available.
|
void |
delete(ID id)
Deletes the entity with the given id.
|
void |
delete(Iterable<? extends T> entities)
Deletes the given entities.
|
void |
delete(T entity)
Deletes a given entity.
|
void |
deleteAll()
Deletes all entities managed by the repository.
|
boolean |
exists(ID id)
Returns whether an entity with the given id exists.
|
Iterable<T> |
findAll()
Returns all instances of the type.
|
Iterable<T> |
findAll(Iterable<ID> ids)
Returns all instances of the type with the given IDs.
|
T |
findOne(ID id)
Retrieves an entity by its id.
|
<S extends T> |
save(Iterable<S> entities)
Saves all given entities.
|
<S extends T> |
save(S entity)
Saves a given entity.
|
<S extends T> S save(S entity)
entity
- <S extends T> Iterable<S> save(Iterable<S> entities)
entities
- IllegalArgumentException
- in case the given entity is null.T findOne(ID id)
id
- must not be null.IllegalArgumentException
- if id
is nullboolean exists(ID id)
id
- must not be null.IllegalArgumentException
- if id
is nullIterable<T> findAll(Iterable<ID> ids)
ids
- long count()
void delete(ID id)
id
- must not be null.IllegalArgumentException
- in case the given id
is nullvoid delete(T entity)
entity
- IllegalArgumentException
- in case the given entity is null.void delete(Iterable<? extends T> entities)
entities
- IllegalArgumentException
- in case the given Iterable
is null.void deleteAll()
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.