openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: Is this possible with CriteriaBuilder method
Date Wed, 20 Apr 2011 16:06:21 GMT
Kevin,
we looked at different queries
I read this one from the (original?) post:
SELECT m.title, m.author, 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! 

-----
Pinaki 
--
View this message in context: http://openjpa.208410.n2.nabble.com/Is-this-possible-with-CriteriaBuilder-method-tp6283183p6291279.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message