How can I limit in a select query of JPQL named query? I need the limit to be done in the query level itself and not in the java layer!!! I am trying to use
@NamedQueries(value = {
@NamedQuery(name = UserNotification.QueryName.NOTIFICATION_DISPLAYED,
query = "SELECT un FROM UserNotification un " +
"WHERE un.orgId IN (:orgList) " +
"AND un.user.id = :userId LIMIT 5")
but in vain!!!
Please suggest