From dev-return-20997-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 26 18:59:09 2012 Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 350FEDED0 for ; Wed, 26 Sep 2012 18:59:09 +0000 (UTC) Received: (qmail 56356 invoked by uid 500); 26 Sep 2012 18:59:09 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 55867 invoked by uid 500); 26 Sep 2012 18:59:08 -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 55646 invoked by uid 99); 26 Sep 2012 18:59:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Sep 2012 18:59:08 +0000 Date: Thu, 27 Sep 2012 05:59:08 +1100 (NCT) From: "Brian Topping (JIRA)" To: dev@openjpa.apache.org Message-ID: <1822910980.129928.1348685948211.JavaMail.jiratomcat@arcas> Subject: [jira] [Created] (OPENJPA-2268) SQL Generation with query using IN element MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Brian Topping created OPENJPA-2268: -------------------------------------- Summary: SQL Generation with query using IN element Key: OPENJPA-2268 URL: https://issues.apache.org/jira/browse/OPENJPA-2268 Project: OpenJPA Issue Type: Bug Components: jdbc, kernel, sql Affects Versions: 2.2.0 Reporter: Brian Topping Hi all, I've been staring at a problem for the last 12 hours with a JPQL query that appears to be parsing incorrectly. There are three tables, a permissions table with a n-n relation to a role table, in turn with an n-n relation to a users table. The intent of the query is to get all permissions for a user by username: {{select p from PersistentPermission p, IN(p.roles) r, IN(r.users) u where u.username = :name}}. No errors are generated, but the SQL emitted to the log has not been parsed or transformed at all. (This may be correct, I've been fortunate enough so far not to have to look at the SQL generated by OpenJPA). Debugging into OpenJPA, it appears that the generated query is "select permission p where username='?'", which obviously will not return anything. I'm still debugging this (having gotten down to the level of the jflex code), but it's my first time going deep on OpenJPA like this so things are going slow. I'll post updates here, but if anyone sees this and has ideas of where to look first (no matter how small), it may be a great help. Thank you1 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira