JPQL limit
Query query = null;
List<Integer> rows;
Integer count = 15;
String query_string = "SELECT c.id FROM NewsEntity c ORDER BY RAND()";
query = em.createQuery(query_string);
query = em.createQuery(query_string);
if (count != null && count > 0) {
query.setMaxResults(count);
}
rows = query.getResultList();
-----------------
Its full answer, enjoy!!!
--
View this message in context:
http://n2.nabble.com/How-to-write-it-in-JPQL-tp211564p4512489.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.