Select manual in repository using Spring?

Asked

Viewed 23 times

0

Hello, I wonder if there is a way to make a select within the Repository, I’m using Spring and REST, I need to return all entities that have another entity, I would take them by id, and I need to feed an ajax call with it, so I would need a json array. If anyone can help, I’d be most grateful.

1 answer

0


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

List<Answer> findByQuestionIdAndDeadIsFalse(String questionId);

I created inside the Repository and call him, making an injection of addiction in the place I need, in my case in Controller.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.