Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 74543 invoked from network); 18 Apr 2011 11:01:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Apr 2011 11:01:44 -0000 Received: (qmail 96518 invoked by uid 500); 18 Apr 2011 11:01:44 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 96452 invoked by uid 500); 18 Apr 2011 11:01:43 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 96444 invoked by uid 99); 18 Apr 2011 11:01:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Apr 2011 11:01:43 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=FREEMAIL_FROM,RFC_ABUSE_POST,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.26 is neither permitted nor denied by domain of chuonglepham@gmail.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Apr 2011 11:01:37 +0000 Received: from jim.nabble.com ([192.168.236.80]) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1QBmCi-0006iy-Ur for users@openjpa.apache.org; Mon, 18 Apr 2011 04:01:16 -0700 Date: Mon, 18 Apr 2011 04:01:16 -0700 (PDT) From: chuongpham To: users@openjpa.apache.org Message-ID: <1303124476935-6283183.post@n2.nabble.com> Subject: Is this possible with CriteriaBuilder method MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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), '
', ' '), 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.