For specific @NamedQueries where a limit is required, you can switch to @NamedNativeQuery
@NamedNativeQuery(
name=UserNotification.QueryName.NOTIFICATION_DISPLAYED_LIMIT5,
query="SELECT un.* FROM user_notification un " +
"WHERE un.user.id = ?1 LIMIT 5",
resultClass=UserNotification.class
)
Not quite as smooth, but does the job.