Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3E7CA200B67 for ; Tue, 16 Aug 2016 17:49:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3C610160AA8; Tue, 16 Aug 2016 15:49:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 829C0160A74 for ; Tue, 16 Aug 2016 17:49:47 +0200 (CEST) Received: (qmail 17169 invoked by uid 500); 16 Aug 2016 15:49:46 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 17144 invoked by uid 99); 16 Aug 2016 15:49:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Aug 2016 15:49:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 79949C1A1E for ; Tue, 16 Aug 2016 15:49:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=objectstyle.org header.b=i/NhThOA; dkim=pass (1024-bit key) header.d=messagingengine.com header.b=raEiItpK Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 0gqFsj-tRFA4 for ; Tue, 16 Aug 2016 15:49:42 +0000 (UTC) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 70CD55FBB5 for ; Tue, 16 Aug 2016 15:49:42 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 39899204F8 for ; Tue, 16 Aug 2016 11:49:42 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Tue, 16 Aug 2016 11:49:42 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=objectstyle.org; h=content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=jfcCCkhPTMPKYFvxCu/sXJ5oTMI=; b=i/NhTh OAbXMABMaXQiRPyS00axt19Y+2Fr0NmAOOK/Zdesl02V5A/Jou6AGyK4v++jW7S7 Jt8iNDY65lpBlY+G8s0jQOuEJhKGOJcp+Wcq2Rz5deXRcyHjSdFlaXPct7ePEQY8 9SgfX0zCmNc82AdnsZ1SZtsOV6yzZ20XkGl1Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=jfcCCkhPTMPKYFv xCu/sXJ5oTMI=; b=raEiItpKY1Ysa9bCIQ0xhiMvyM58sVUxfvsIPuw99Cmvrop YR7Ofg+xO+UT7Q/kmcCo+jnWAYnx/AS6zmw5LjGy3xTBOKYGNxbJV9UpRHf6zVZh S6rGLZFm4vm3bha0A0fNN9b9TWN34FW/vp+9Bpu5vwPee5opEwBIz3LEDk1U= X-Sasl-enc: RJOmzDXk3nQsQSsI5Sgg6fDFGRhK+VYXGGyNyoSmGAAX 1471362581 Received: from [192.168.1.52] (unknown [37.17.49.228]) by mail.messagingengine.com (Postfix) with ESMTPA id AF287CCE75 for ; Tue, 16 Aug 2016 11:49:41 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Show the SQL that will be generated by an EJBQLQuery? From: Andrus Adamchik In-Reply-To: <9D3823BE-B5B6-41F6-B55C-B022F8B07E60@karlmenn.is> Date: Tue, 16 Aug 2016 18:49:40 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <66CFAB55-9367-4D0A-8785-F42CCD8C3802@objectstyle.org> References: <9D3823BE-B5B6-41F6-B55C-B022F8B07E60@karlmenn.is> To: user@cayenne.apache.org X-Mailer: Apple Mail (2.3124) archived-at: Tue, 16 Aug 2016 15:49:48 -0000 EJBQL translation goes through a phase of creating a SQLTemplate, which = is essentially SQL with embedded Velocity directives. Then SQLTemplate = is executed against the DB. All this happens inside EJBQLAction [1]. So = perhaps you can copy some of this code and put it in your unit test and = analyze SQLTemplate contents?=20 The only "context" you will need is DataNode. It is available via = injection inside any test that inherits from ServerCase: @Inject protected DataNode node; Andrus [1] = https://github.com/apache/cayenne/blob/master/cayenne-server/src/main/java= /org/apache/cayenne/access/jdbc/EJBQLAction.java > On Aug 16, 2016, at 6:36 PM, Hugi Thordarson wrote: >=20 > Hi all, > since I want to try to do a little work on EJBQL in Cayenne; is there = any way for me to generate and look at the SQL that will be generated by = an EJBQLQuery without actually submitting it to the DB? >=20 > Cheers, > - hugi >=20 > // Hugi Thordarson > // http://www.loftfar.is/ > // s. 895-6688 >=20 >=20 >=20