Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-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 5031E9E61 for ; Mon, 14 Nov 2011 17:10:18 +0000 (UTC) Received: (qmail 5404 invoked by uid 500); 14 Nov 2011 17:10:18 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 5387 invoked by uid 500); 14 Nov 2011 17:10:18 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 5380 invoked by uid 99); 14 Nov 2011 17:10:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2011 17:10:18 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2011 17:10:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 889B082DD8 for ; Mon, 14 Nov 2011 17:09:51 +0000 (UTC) Date: Mon, 14 Nov 2011 17:09:51 +0000 (UTC) From: "Sandeep Dixit (Created) (JIRA)" To: derby-dev@db.apache.org Message-ID: <1408627039.27229.1321290591561.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (DERBY-5501) Subquery is only allowed to return a single column - When using derby with hibernate (or JPA) queries are created per JPA spec. For tables with multi-column PK, subqueries are created with two columns in select clause. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Subquery is only allowed to return a single column - When using derby with = hibernate (or JPA) queries are created per JPA spec. For tables with multi-= column PK, subqueries are created with two columns in select clause. ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= -------------------------------------------------------------------- Key: DERBY-5501 URL: https://issues.apache.org/jira/browse/DERBY-5501 Project: Derby Issue Type: Bug Affects Versions: 10.8.2.2 Environment: Max/Linux Reporter: Sandeep Dixit ERROR: Subquery is only allowed to return a single column. PROBLEM: When using derby with hibernate (or JPA) queries are created by th= e JPA engine per JPA spec. For tables with multi-column PK, subqueries are = created with two columns in select clause (see select colofassig6_.activity= ID, colofassig6_.assigneeID from Assignment in the query below). Without this support, I can not use Derby with JPA. Hibernate: select distinct activitybe0_.activityID as activityID69_, activi= tybe0_.createdBy as createdBy69_, activitybe0_.createdOn as createdOn69_, a= ctivitybe0_.lastModifiedBy as lastModi4_69_, activitybe0_.lastModifiedOn as= lastModi5_69_, activitybe0_.activityDate as activity6_69_, activitybe0_.ac= tivityTypeHierarchyID as activity7_69_, activitybe0_.activityTypeID as acti= vity8_69_, activitybe0_.campaignID as campaignID69_, activitybe0_.comments = as comments69_, activitybe0_.description as descrip11_69_, activitybe0_.inp= utID as inputID69_, activitybe0_.inputTypeID as inputTy13_69_, activitybe0_= .name as name69_, activitybe0_.notes as notes69_, activitybe0_.organization= ID as organiz16_69_, activitybe0_.parentActivityTypeID as parentA17_69_ fro= m Activity activitybe0_, Activity activitybe1_ inner join ActivitySchedule = colofactiv2_ on activitybe1_.activityID=3Dcolofactiv2_.activityID inner joi= n ActivityScheduleStatus colofactiv3_ on colofactiv2_.activityScheduleID=3D= colofactiv3_.activityScheduleID inner join ActivityScheduleStatusType activ= itysc4_ on colofactiv3_.activityScheduleStatusTypeID=3Dactivitysc4_.activit= yScheduleStatusTypeID, ActivityTypeHierarchy activityty5_ where activitybe0= _.activityTypeHierarchyID=3Dactivityty5_.activityTypeHierarchyID and activi= tyty5_.activityTypeHierarchyID=3D? and not (exists (select colofassig6_.ac= tivityID, colofassig6_.assigneeID from Assignment colofassig6_ where activi= tybe0_.activityID=3Dcolofassig6_.activityID)) and (activitybe0_.activityID<= >activitybe1_.activityID or activitysc4_.name<>'Route') 2011-11-14 11:41:13,413 ERROR [org.hibernate.util.JDBCExceptionReporter] (E= JB-Timer-1321288405420[target=3Djboss.j2ee:ear=3Doecrm1.6.3RC1-derby-jboss.= ear,jar=3Dbuilder-ejb.jar,name=3DWorkflowActivatorBean,service=3DEJB3]) Sub= query is only allowed to return a single column. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira