openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: Is this possible with CriteriaBuilder method
Date Wed, 20 Apr 2011 16:06:21 GMT
we looked at different queries
I read this one from the (original?) post:
SELECT m.title,, REPLACE(SUBSTRING_INDEX(m.content, ' ', 20),
'<br>', ' '), m.viewed, m.hashid FROM book m WHERE m.lang = ?1 AND m.title
like CONCAT('%',?2,'%') ORDER BY m.title asc 

On a second look I see you post a different one with @rownum in SELECT
projection clause etc.

Firstly, I do not have an answer for that @rownum trick using Criteria API.
Secondly, I though the question is about that REPLACE() function.
Thirdly, the trick is not required at all with JPA query. The @rownumber
stuff add a monotonic row number to the selected results.  But JPA results
are in a java.util.List anyway which is ordered by definition! 

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message