From dev-return-15044-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Sat Feb 13 05:38:50 2010 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 13881 invoked from network); 13 Feb 2010 05:38:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Feb 2010 05:38:50 -0000 Received: (qmail 21694 invoked by uid 500); 13 Feb 2010 05:38:50 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 21586 invoked by uid 500); 13 Feb 2010 05:38:49 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 21576 invoked by uid 99); 13 Feb 2010 05:38:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Feb 2010 05:38:49 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of plinskey@gmail.com designates 209.85.210.171 as permitted sender) Received: from [209.85.210.171] (HELO mail-yx0-f171.google.com) (209.85.210.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Feb 2010 05:38:40 +0000 Received: by yxe1 with SMTP id 1so3038163yxe.3 for ; Fri, 12 Feb 2010 21:38:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=tj6yDt1wzsgRsKfhcHKGHzcwqIoCbFlmCzMTXVSHxQ4=; b=gKNypsyflZje8h0FsdwxNyBdPbt4bvjUhIFMklsAYFGDuhzk6oaTIgWSqt2PFLplZ8 L0wn1Hw1SaeWmOevUtDLpWJ1FTcEDz1PwnyAhCZ76yDFTbEoFSy05dGTpc0KQ6LKdA8X Sft9ok3cM8rIeyIQ4IZ4Jg1/baaxc5Em7+EfM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=rQg2DaiicFy4t8nvklrqYyLZSyomVIr+IzY/Fdf+LWvlFfMBI6IYtpuzutUB2fW3hu ECZecTcVLxsvmff+uT0z1dqW5Xg8MJceUBDdgDDtb713U+iCkdoqW3GygJmACd9k2pGb aQVgV2kDUvGciX9756q38Ejgd+VNqrbdgk5iE= Received: by 10.150.55.14 with SMTP id d14mr3796352yba.302.1266039499173; Fri, 12 Feb 2010 21:38:19 -0800 (PST) Received: from ?192.168.1.121? (c-69-181-104-186.hsd1.ca.comcast.net [69.181.104.186]) by mx.google.com with ESMTPS id 9sm1631018yxf.59.2010.02.12.21.38.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 12 Feb 2010 21:38:18 -0800 (PST) Message-Id: <18B4E6B8-B3CA-4CF6-915A-7AF00499E8DC@gmail.com> From: Patrick Linskey To: dev@openjpa.apache.org In-Reply-To: <58E25657-AF24-4A9B-87A7-54A43BC5BE5A@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Question about JPQLExpressionBuilder.getTypeLiteral() Date: Fri, 12 Feb 2010 21:38:16 -0800 References: <58E25657-AF24-4A9B-87A7-54A43BC5BE5A@gmail.com> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org Digging into this further, it looks like the getVariable() call is relatively unused. Maybe it's just a validation check? If so, what's it validating? Do we support path traversals etc. in type comparisons, or just comparisons to parameters and literals? Thanks, -Patrick On Feb 12, 2010, at 5:12 PM, Patrick Linskey wrote: > Hi, > > I'm working on adding support for queries against a non-relational > store, and I've run into an issue with the new JPA2 type literal > stuff. > > I'm compiling a query such as the following: > > select s from Skier s where type(s) = Skier > > My target database doesn't support joins, so in my ExpressionFactory > implementation, I throw exceptions whenever join-ish things are done. > > I'm getting into trouble because > JPQLExpressionBuilder.getTypeLiteral() calls getVariable(), which > ends up calling ExpressionFactory.newUnboundVariable() eventually. > Which blows up. > > Now, I could change my implementation to not throw in > newUnboundVariable(), but I feel like a type literal isn't a > variable. Was there some larger bit of rationale behind making > getTypeLiteral() return an unbound variable, or should I feel free > to dig into changing it to return a more suitable type? > > (Incidentally, I've got things working with type parameters (i.e., > 'where type(s) = :type'), so the pathways seem to be great aside > from this variable discrepancy.) > > Thanks, > > -Patrick > > -- > Patrick Linskey > 202 669 5907 > -- Patrick Linskey 202 669 5907