Hi, I think the real question is whether your native MySQL query can be represented with JPQL... If you can represent this query in the object space, then it should be doable via either JPQL or the CriteriaBuilder. Looking at the query below, the only questionable part is the "@rownum" user variable usage. The rest of it looks pretty straight forward.
Kevin On Mon, Apr 18, 2011 at 6:01 AM, chuongpham <[email protected]> wrote: > Can I convert this native MySQL query using purely the CriteriaBuilder > method: > > SELECT @rownum:=@rownum+1 'no', m.title, m.author, > REPLACE(SUBSTRING_INDEX(m.content, ' ', 20), '<br>', ' '), m.viewed, > m.hashid FROM book m, (SELECT @rownum:=0) r WHERE m.lang = ?1 AND m.title > like CONCAT('%',?2,'%') ORDER BY m.title asc > > I can't find a similar example to reference from the JEE 6 Tutorial > available at Oracle website. > > > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/Is-this-possible-with-CriteriaBuilder-method-tp6283183p6283183.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >
