In my code Appointment is a entity and Long id is its primary key.
In the below code when i write findById(Long id), the return type required is Optional.
But when i write findAppointmentById(Long id), the return type required is Appointment.
What is difference between findById(Long id) and findAppointmentById(Long id) ??
public interface AppointmentDao extends CrudRepository<Appointment, Long>{
Optional<Appointment> findById(Long id);
}