Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 42214 invoked from network); 11 Jun 2007 15:54:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2007 15:54:38 -0000 Received: (qmail 32993 invoked by uid 500); 11 Jun 2007 15:54:41 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 32969 invoked by uid 500); 11 Jun 2007 15:54:41 -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 32960 invoked by uid 99); 11 Jun 2007 15:54:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2007 08:54:41 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of ppoddar@bea.com designates 66.248.192.39 as permitted sender) Received: from [66.248.192.39] (HELO repmmg02.bea.com) (66.248.192.39) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2007 08:54:37 -0700 Received: from repmmr01.bea.com (repmmr01.bea.com [10.160.29.71]) by repmmg02.bea.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id l5BFsFXX018217 for ; Mon, 11 Jun 2007 08:54:15 -0700 Received: from repbex01.amer.bea.com (repbex01.bea.com [10.160.26.98]) by repmmr01.bea.com (Switch-3.2.7/Switch-3.2.5) with ESMTP id l5BFs4Bd012041 for ; Mon, 11 Jun 2007 08:54:05 -0700 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: RE: Newbie question: Subselect with MySQL Date: Mon, 11 Jun 2007 08:50:52 -0700 Message-ID: <3992B07C0590B548BB294D31768A1DA212EB60@repbex01.amer.bea.com> In-Reply-To: <466D699D.9090103@etf.bg.ac.yu> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Newbie question: Subselect with MySQL Thread-Index: AcesPP+LdaMz/v+0RHqd0fs54chNQQAAiN0g References: <466D699D.9090103@etf.bg.ac.yu> From: "Pinaki Poddar" To: x-BEA-PMX-Instructions: AV x-BEA-MM: Internal-To-External X-Virus-Checked: Checked by ClamAV on apache.org Set the following property in META-INF/persistence.xml when you are using MySQL. This property is set to false by deafult in openjpa.jdbc.MySQLDictionary to accomodate older MySQL versions. OpenJPA provides extensive options to configure a database declaratively http://openjpa.apache.org/docs/latest/manual/manual.html#ref_guide_dbset up_dbdictprops Also you can programatically extend the DBDictionary (or its derivations) for special purposes. Pinaki Poddar BEA Systems 415.402.7317 -----Original Message----- From: Ognjen Blagojevic [mailto:ognjen@etf.bg.ac.yu] Sent: Monday, June 11, 2007 10:26 AM To: dev@openjpa.apache.org Subject: Newbie question: Subselect with MySQL Hello, I am new to OpenJPA, and I have a question regarding subselects. When I try to invoke an EJB QL query like this: select p from Person p where p.id in (select st.idPerson.id from Student st) I get the following exception: Exception in thread "main" <0.9.7-incubating fatal general error> org.apache.openjpa.persistence.PersistenceException: The database dictionary in use ("class org.apache.openjpa.jdbc.sql.MySQLDictionary") reports that it does not have feature "SupportsSubselect". This feature is needed to complete the current operation. To force OpenJPA to try to use the feature anyway, set the following property: openjpa.jdbc.DBDictionary: SupportsSubselect= at ... I'm using MySQL 4.1.16, which have subselect support, and writing this query in native SQL is easy. How can I use subselects with OpenJPA and EJB QL? Thanks, Ognjen Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.