All instances (objects) of an entity class can be loaded from the underlying database table as follows (akin to retrieving all rows from the table):
Iterable<Foo> foos = fooRepository.findAll();
findAll method is provided by the
CrudRepository interface. It returns an
Iterable instead of a more concrete type like
Set because some implementations of the interface may be unable to return a
Collection type and therefore using a
Collection type for the returned value will result in loss of functionality for them.
findAll method results in the JPA query
select foo from Foo foo being executed on the underlying database.