Select manual in repository using Spring?

0
Hello, I would like to know if there is a way to do a select within Repository , I am using Spring and REST , I need to return all entities that have another entity, I would get them by id, and I need to feed a call ajax with it, then it would need a json array. If anyone can help, I would be very grateful.

    
asked by anonymous 17.08.2016 / 15:48

1 answer

0

I found the solution, I create methods with specific names like this:

List<Answer> findByQuestionIdAndDeadIsFalse(String questionId);

I created inside Repository and called it, making a dependency injection where I need it, in my case not Controller .

    
17.08.2016 / 22:08