Spring Data JPA Custom Query limit functionality not working

Viewed 14241

I have created a custom Query

@Repository
public interface SecurityQuestionRepository extends JpaRepository<SecurityQuestion, Integer>{

    @Query("select q from SecurityQuestion q order by q.questionId asc limit 0, 3 ")
    public List<SecurityQuestion> findQuestion();

}

When I call the service and invoked public List<SecurityQuestion> findQuestion() method limit 0,3 is not working

Here is the hibernate log,

Hibernate: select securityqu0_.question_id as question1_4_, securityqu0_.question_desc as question2_4_ from user_security_question securityqu0_ order by securityqu0_.question_id asc

How to made this limit functionality working in this?

3 Answers
Related