Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 28805 invoked from network); 3 May 2004 11:51:09 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 May 2004 11:51:09 -0000 Received: (qmail 74146 invoked by uid 500); 3 May 2004 11:51:03 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 74128 invoked by uid 500); 3 May 2004 11:51:03 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 74101 invoked from network); 3 May 2004 11:51:02 -0000 Received: from unknown (HELO msgdirector2.onetel.net.uk) (212.67.96.149) by daedalus.apache.org with SMTP; 3 May 2004 11:51:02 -0000 Received: from bolek.coachhouse (213-78-121-52.friaco.onetel.net.uk [213.78.121.52]) by msgdirector2.onetel.net.uk (Mirapoint Messaging Server MOS 3.3.6-GR) with ESMTP id BHP40322; Mon, 3 May 2004 12:49:35 +0100 (BST) Received: (Exim 3.35) #1 (Debian)) protocol: esmtp id 1BKbt1-0002sH-00 ; Mon, 03 May 2004 12:45:27 +0100 Message-ID: <409630DA.9000804@numerixtechnology.de> Date: Mon, 03 May 2004 12:45:30 +0100 From: T E Schmitz Reply-To: mailreg@numerixtechnology.de User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Apache Torque Users List Subject: Re: doSelectAllExcept... reference the same table twice References: <40953CF4.1080002@numerixtechnology.de> <40960E0D.2080003@ifit.uni-klu.ac.at> In-Reply-To: <40960E0D.2080003@ifit.uni-klu.ac.at> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thank you for your reply, Kostya. I am wondering whether I could generate this behaviour into BaseXXXPeer. I had a look at the Criteria src code and I don't think it would be to difficult. The only problem might be alias (BRAND as b1) in the FROM clause. Regards, Tarlika Kostyantyn Shchekotykhin wrote: > Hi Tarlika, > you should write direct strings if you want to use aliases. I mean, you > should get the attribute name from the Torque constant and concat alias > name and attribute name. > String aliasName = "b1"; > String b1brandName = aliasName + > Brand.BRAND_NAME.substring(Brand.BRAND_NAME.indexOf(".")); > > Regards, > Kostya > > T E Schmitz wrote: > >> Hello, >> >> I have a table which references the same table twice. In SQL, I would >> express the SELECT (inner join) using an alias : >> >> SELECT >> SECTION.SECTION_PK, >> SECTION.SECTION_NAME, >> SECTION.BRAND_1_FK, >> SECTION.BRAND_2_FK, >> b1.BRAND_PK, >> b1.BRAND_NAME, >> b2.BRAND_PK, >> b2.BRAND_NAME >> >> FROM SECTION, BRAND as b1,BRAND as b2 >> where b1.BRAND_PK = BRAND_1_FK and >> b2.BRAND_PK = BRAND_2_FK >> >> Torque, however, will generate >> BRAND.BRAND_PK, >> BRAND.BRAND_NAME >> as the columns are static variables fully qualified by the tableir name. >> --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org