Important Spring Data JPA Methods
Important Spring Data JPA Methods
Methods
By Ramesh Fadatare (Java Guides)
save() method
As the name depicts, the save() method allows
us to save an entity to the DB.
ndById() method
As the name depicts, the ndById() method
allows us to get or retrieve an entity based on
a given id (primary key) from the DB.
ndAll() method
As the name depicts, the ndAll() method
allows us to get or retrieve all the entities
from the database table.
fi
deleteById() method
As the name depicts, the deleteById() method
allows us to delete an entity by id from the
database table.
delete() method
As the name depicts, the delete() method
allows us to delete an entity from the database
table.
deleteAll() two
overloaded method
As the name depicts, the deleteAll() method
allows us to delete all the entities from the
database table.
existsById() method
As the name depicts, the existsById() method
allows us to check if the entity exists with a
given id in a database table.
count() method
As the name depicts, the count() method
allows us to count the number of records that
exist in a database table.