In this lecture, we have discussed the findOne() and findAll() methods in JPA.
findOne() method is used to retrieve a single record from the database and it requires an ID (primary key of that table);
findAll() method is used to finding the list/collection of data from the database.
To fetch data from the database of any entity we require a repository for that entity class.
The custom methods to interact with the database are being written in the repository.
This Repository extends either CrudJpaRepository or JpaRepository.
social links:
Facebook page :
/ rajajideveloperbaboo
do{
subscribe();
} while(!subscribed);
do{
like();
}while(!liked);
do{
comments();
}while(1);