I'm developing an application using Spring MVC, with spring data jpa in the persistence layer.
When I try to do a search using the method findOne
(or findById
) will always return null.
I already checked the database and there is a registered record with the indicated Id.
Method call:
public Atividade findById(short id) {
return atividades.findOne(id);
}
Error while trying to search:
java.lang.NullPointerException: null at br.com.transformare.service.AtivityService.findById (ActivityService.java:32)
Can anyone tell me if it would be some error in my code or some spring data bug?