1

I have query as such :

@Query("select a from Ability a where a.eventLogic = ?1 AND a.abilitySetId = ?2 ORDER BY    RAND() LIMIT ?3")

BUt i get an error:

Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: LIMIT near line 1, column 117

How can i programmatically put in the limit number?

user1555190
  • 2,803
  • 8
  • 47
  • 80

2 Answers2

1

spring data jpa, has documentation, that states how to solve this using some paging. Thats what i used

user1555190
  • 2,803
  • 8
  • 47
  • 80
0

I had a similar issue and adding an explicit ASC clause solved it.

Stephane
  • 11,836
  • 25
  • 112
  • 175