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 1955476D2 for ; Mon, 21 Nov 2011 21:25:20 +0000 (UTC) Received: (qmail 38370 invoked by uid 500); 21 Nov 2011 21:25:18 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 38344 invoked by uid 500); 21 Nov 2011 21:25: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 38317 invoked by uid 99); 21 Nov 2011 21:25:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Nov 2011 21:25: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, 21 Nov 2011 21:25: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 88B5C42171 for ; Mon, 21 Nov 2011 21:24:52 +0000 (UTC) Date: Mon, 21 Nov 2011 21:24:52 +0000 (UTC) From: "Dag H. Wanvik (Commented) (JIRA)" To: derby-dev@db.apache.org Message-ID: <333258637.53229.1321910692561.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1408627039.27229.1321290591561.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (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 [ https://issues.apache.org/jira/browse/DERBY-5501?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1315= 4544#comment-13154544 ]=20 Dag H. Wanvik commented on DERBY-5501: -------------------------------------- Committed derby-5501-3 as svn 1204712, resolving. This is a back-port candi= date.=20 Sandeep, would you have a chance to validate this change in your environmen= t either by compiling Derby trunk with the patch or downloading a binary sn= apshot? =20 > Subquery is only allowed to return a single column - When using derby wit= h hibernate (or JPA) queries are created per JPA spec. For tables with mult= i-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: Improvement > Components: SQL > Affects Versions: 10.8.2.2 > Environment: Max/Linux > Reporter: Sandeep Dixit > Assignee: Dag H. Wanvik > Attachments: derby-5501-1.diff, derby-5501-1.stat, derby-5501-2.d= iff, derby-5501-2.diff, derby-5501-3.diff, derby-5501-3.stat, derby-5501-re= pro.diff > > > ERROR: Subquery is only allowed to return a single column. > PROBLEM: When using derby with hibernate (or JPA) queries are created by = the JPA engine per JPA spec. For tables with multi-column PK, subqueries ar= e created with two columns in select clause (see select colofassig6_.activi= tyID, 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_, acti= vitybe0_.createdBy as createdBy69_, activitybe0_.createdOn as createdOn69_,= activitybe0_.lastModifiedBy as lastModi4_69_, activitybe0_.lastModifiedOn = as lastModi5_69_, activitybe0_.activityDate as activity6_69_, activitybe0_.= activityTypeHierarchyID as activity7_69_, activitybe0_.activityTypeID as ac= tivity8_69_, activitybe0_.campaignID as campaignID69_, activitybe0_.comment= s as comments69_, activitybe0_.description as descrip11_69_, activitybe0_.i= nputID as inputID69_, activitybe0_.inputTypeID as inputTy13_69_, activitybe= 0_.name as name69_, activitybe0_.notes as notes69_, activitybe0_.organizati= onID as organiz16_69_, activitybe0_.parentActivityTypeID as parentA17_69_ f= rom Activity activitybe0_, Activity activitybe1_ inner join ActivitySchedul= e colofactiv2_ on activitybe1_.activityID=3Dcolofactiv2_.activityID inner j= oin ActivityScheduleStatus colofactiv3_ on colofactiv2_.activityScheduleID= =3Dcolofactiv3_.activityScheduleID inner join ActivityScheduleStatusType ac= tivitysc4_ on colofactiv3_.activityScheduleStatusTypeID=3Dactivitysc4_.acti= vityScheduleStatusTypeID, ActivityTypeHierarchy activityty5_ where activity= be0_.activityTypeHierarchyID=3Dactivityty5_.activityTypeHierarchyID and act= ivityty5_.activityTypeHierarchyID=3D? and not (exists (select colofassig6_= .activityID, colofassig6_.assigneeID from Assignment colofassig6_ where act= ivitybe0_.activityID=3Dcolofassig6_.activityID)) and (activitybe0_.activity= ID<>activitybe1_.activityID or activitysc4_.name<>'Route') > 2011-11-14 11:41:13,413 ERROR [org.hibernate.util.JDBCExceptionReporter] = (EJB-Timer-1321288405420[target=3Djboss.j2ee:ear=3Doecrm1.6.3RC1-derby-jbos= s.ear,jar=3Dbuilder-ejb.jar,name=3DWorkflowActivatorBean,service=3DEJB3]) S= ubquery 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