Return-Path: X-Original-To: apmail-empire-db-commits-archive@www.apache.org Delivered-To: apmail-empire-db-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E4352EFAC for ; Mon, 4 Feb 2013 14:12:14 +0000 (UTC) Received: (qmail 39600 invoked by uid 500); 4 Feb 2013 14:12:14 -0000 Delivered-To: apmail-empire-db-commits-archive@empire-db.apache.org Received: (qmail 39572 invoked by uid 500); 4 Feb 2013 14:12:14 -0000 Mailing-List: contact commits-help@empire-db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-dev@empire-db.apache.org Delivered-To: mailing list commits@empire-db.apache.org Received: (qmail 39539 invoked by uid 500); 4 Feb 2013 14:12:14 -0000 Delivered-To: apmail-incubator-empire-db-commits@incubator.apache.org Received: (qmail 39529 invoked by uid 99); 4 Feb 2013 14:12:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 14:12:14 +0000 Date: Mon, 4 Feb 2013 14:12:14 +0000 (UTC) From: =?utf-8?Q?Rainer_D=C3=B6bele_=28JIRA=29?= To: empire-db-commits@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (EMPIREDB-75) DBCommand should allow me to select duplicate columns 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/EMPIREDB-75?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Rainer D=C3=B6bele closed EMPIREDB-75. --------------------------------- Cleanup of unclosed issues. =20 > DBCommand should allow me to select duplicate columns > ----------------------------------------------------- > > Key: EMPIREDB-75 > URL: https://issues.apache.org/jira/browse/EMPIREDB-75 > Project: Empire-DB > Issue Type: Bug > Components: Core > Affects Versions: empire-db-2.0.5-incubating > Environment: Win32, JDK1.6.0_15 > Reporter: Greg Reiser > Assignee: Rainer D=C3=B6bele > > Allowing the option to (explicitly) select a duplicate column in DBComman= d would be helpful for a UNION type of statement. Here is the scenario: I h= ave enterprise educators that are able to work within all colleges in a uni= versity while I have others that can only work in specific colleges (specia= lized). Also, each educator can have an enterprise id and/or a facility-spe= cific ID. I need to be able to query the possible educators for a specific = college. Here is my SQL: > SELECT t70.EDUCATOR_CODE, t69.EDUCATOR_ID, t69.EDUCATOR_SID > FROM EDUCATOR t69, EDUCATOR_FACILITY t70 > WHERE t69.EDUCATOR_SID=3Dt70.EDUCATOR_SID AND t69.STATUS=3D1 AND t70.FACI= LITY_SID=3D355=20 > UNION=20 > SELECT t69.EDUCATOR_ID, t69.EDUCATOR_ID, t69.EDUCATOR_SID > FROM EDUCATOR t69 > WHERE t69.FACILITY_MAP_CODE=3D1 AND t69.STATUS=3D1 > An overloaded select() method on DBCommand was sufficient in my dev envir= onment: > public void select(DBColumnExpr expr, boolean allowDuplicateColumns) > { // Select this column > if (select =3D=3D null) > select =3D new ArrayList(); > if (expr !=3D null && allowDuplicateColumns ? true : (select.cont= ains(expr) =3D=3D false)) > select.add(expr); > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira