Interface CrudRepository<E,K>
public interface CrudRepository<E,K>
Base contract for generated repositories. The caller owns the Session and transaction.
save returns the managed merge result; insert schedules a new instance for persistence.
-
Method Summary
Modifier and TypeMethodDescriptionlongcount()voidDeletes one entity, managed or detached, as Spring Data'sdeletedoes: a detached instance is merged first, so the row it stands for is removed.voidDeletes every entity of this type, one by one, so cascades and lifecycle callbacks run as they do fordelete.voidDeletes each of the given entities, asdeletedoes.voiddeleteById(K id) booleanexistsById(K id) findAll()findAllById(Iterable<K> ids) The entities whose ids are given, in the order given; an id with no row is skipped, so the list can be shorter than the input.voidflush()Writes pending changes of the caller's session now, rather than at commit.voidSaves each of the given entities, assavedoes, and answers the managed results in the same order.
-
Method Details
-
findById
-
save
-
insert
-
deleteById
-
findAll
-
count
long count() -
existsById
-
delete
Deletes one entity, managed or detached, as Spring Data'sdeletedoes: a detached instance is merged first, so the row it stands for is removed. An entity whose row no longer exists is ignored. Requires a transaction. -
deleteAll
void deleteAll()Deletes every entity of this type, one by one, so cascades and lifecycle callbacks run as they do fordelete. Requires a transaction. -
deleteAll
-
saveAll
-
findAllById
-
flush
void flush()Writes pending changes of the caller's session now, rather than at commit.
-