From torque-user-return-6710-apmail-db-torque-user-archive=db.apache.org@db.apache.org Fri Jan 20 12:16:23 2006 Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 289 invoked from network); 20 Jan 2006 12:16:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Jan 2006 12:16:23 -0000 Received: (qmail 86055 invoked by uid 500); 20 Jan 2006 12:16:21 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 86031 invoked by uid 500); 20 Jan 2006 12:16:21 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 86020 invoked by uid 99); 20 Jan 2006 12:16:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jan 2006 04:16:21 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [206.190.39.107] (HELO web50812.mail.yahoo.com) (206.190.39.107) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 20 Jan 2006 04:16:20 -0800 Received: (qmail 39253 invoked by uid 60001); 20 Jan 2006 12:15:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=DfteE0i7CTrm3Ynu/xehSjy/SeisMGNcIOSUuoXlMoRrKvAbUmD4l5GLku8oiI33N30Uj9A4AagAn5il49P/jO2gnKb/YpePXTrSdYDZd+vgrz+OolMpWLIvc48ig/MKSuYpthC6gAtRzkfXxPnxQBHVErEC+Uw+iIwwtfQcoq8= ; Message-ID: <20060120121559.39251.qmail@web50812.mail.yahoo.com> Received: from [201.217.140.25] by web50812.mail.yahoo.com via HTTP; Fri, 20 Jan 2006 04:15:59 PST Date: Fri, 20 Jan 2006 04:15:59 -0800 (PST) From: Alvaro Coronel Subject: RE: Joins in torque (slightly Off Topic) To: Apache Torque Users List In-Reply-To: <8F5843B903F59D4C8C6806BB49A3911906295A@dukece-mail3.dukece.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-2086227202-1137759359=:38447" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-2086227202-1137759359=:38447 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Can you recommend a tool like MS Query Analyzer for MySQL Thx! Álvaro Greg Monroe wrote: An alternate thought is to just create a view in the database (MySQL V5 supports them) and then do a psuedo table in the XML to generate the required classes. You probably already know this, but when you're doing complex joins like this, pay close attention to what needs to be indexed. Without the right indices, a large join query against a large number of records can grind your app to a halt. I tend to spend some time in a Query Analyzer type tool (e.g. MS SQL's Query Analyzer...lol) to optimize any complex queries that underlie views. > -----Original Message----- > From: Stephan Spiegel [mailto:spiegel@szwo.de] > Sent: Thursday, January 19, 2006 11:17 AM > To: torque-user@db.apache.org > Subject: Joins in torque > > > Hi, (in case this message is double please excuse me) > > I really do not understand what to do, I do not get the > expected results! > > Letīs say I have 3 Tables: T1, T2 and T1_2 > T1: > ID (integer pk) > value (varchar) > ... > > T2: > ID (integer pk) > value (varchar) > ... > > T1_2: > T1_ID (integer fk->T1) > T2_ID (integer fk->T2) > > As a result, I would like to have a union table showing the > values of T1 and T2 in SQL this would be: select T1.value, > T2.value from T1, T2, T1_2 where T1.ID = T1_2.T1_ID and T2.ID > = T1_2.T2_ID > > if I get more than this (select * ...) would be fine as well. > > So, I have my classes but when I try to use them as written > in Peers HowTo > (doSelectJoin...) or in Criteria HowTo (crit.addJoin(...)) I > always get only the values of the T1_2-table > > As a first step, I try just to get the first half (result > should show: T1.value, T1_2.T2_ID) so it should correspond to: > doSelectJoinT1(crit) in T1_2Peer > or: > crit.addJoin(T1.ID,T1_2.T1_ID,Criteria.LEFT_JOIN) > > as a result I just get the T1_2 values. I checked the > mailing-list-archives, I canīt find a helpful message. Where > is my mistake? Could somebody tell me exactly how to add this join? > > (Iīm using torque-3.2, MySQL 5, defaultidMethod=native) > > thanks in advance, Stephan > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > > Duke CE Privacy Statement Please be advised that this e-mail and any files transmitted with it are confidential communication or may otherwise be privileged or confidential and are intended solely for the individual or entity to whom they are addressed. If you are not the intended recipient you may not rely on the contents of this email or any attachments, and we ask that you please not read, copy or retransmit this communication, but reply to the sender and destroy the email, its contents, and all copies thereof immediately. Any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org --------------------------------- Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars. --0-2086227202-1137759359=:38447--