Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 14555 invoked from network); 24 Jan 2004 14:52:19 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Jan 2004 14:52:19 -0000 Received: (qmail 42262 invoked by uid 500); 24 Jan 2004 14:52:13 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 42236 invoked by uid 500); 24 Jan 2004 14:52:13 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 42222 invoked from network); 24 Jan 2004 14:52:13 -0000 Received: from unknown (HELO hm61.locaweb.com.br) (200.213.197.161) by daedalus.apache.org with SMTP; 24 Jan 2004 14:52:13 -0000 Received: (qmail 25934 invoked from network); 24 Jan 2004 14:51:44 -0000 Received: from hm20.locaweb.com.br (200.246.179.120) by hm61.locaweb.com.br with QMTP; 24 Jan 2004 14:51:44 -0000 Received: (qmail 23742 invoked by uid 23435); 24 Jan 2004 14:52:16 -0000 Message-ID: <20040124145216.23741.qmail@hm20.locaweb.com.br> From: "Leandro Rodrigo Saad Cruz" Date: Sat, 24 Jan 2004 12:52:16 -0200 To: "OJB Developers List" Subject: Re: Aliases on MtoN queries not working anymore References: <40127C9C.8030308@gmx.ch> In-Reply-To: <40127C9C.8030308@gmx.ch> X-Mailer: LocaMail X-IPAddress: 200.219.150.81 X-Sender: leandro@ibnetwork.com.br MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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 Excellent ! Thanks Jakob ! -- Leandro Rodrigo Saad Cruz IT - Inter Business Tecnologia e Servi�os (IB) http://www.ibnetwork.com.br http://db.apache.org/ojb http://xingu.sf.net On Sat, 24 Jan 2004 15:09:32 +0100, Jakob Braeuchi escreveu: > De: Jakob Braeuchi > Data: Sat, 24 Jan 2004 15:09:32 +0100 > Para: OJB Developers List > Assunto: Re: Aliases on MtoN queries not working anymore > > hi leandro, > > i just commited a fix to solve the problem you reported. > the two queries no look like this: > > SELECT DISTINCT A0.LASTNAME,A0.FIRSTNAME,A0.ID FROM PERSON A0,PERSON_PROJECT > WHERE (PERSON_PROJECT.PROJECT_ID IN ( '2' , '7' )) AND A0.ID = > PERSON_PROJECT.PERSON_ID > > > SELECT DISTINCT PERSON_PROJECT.PROJECT_ID,PERSON_PROJECT.PERSON_ID FROM PERSON > A0,PERSON_PROJECT WHERE (PERSON_PROJECT.PROJECT_ID IN ( '2' , '7' )) AND A0.ID = > PERSON_PROJECT.PERSON_ID > > hth > jakob > > Jakob Braeuchi wrote: > > > hi leandro, > > > > i can confirm the problem with the missing alias :( > > > > the first query (using the alias)loads the related objects : > > > > SELECT DISTINCT A0.LASTNAME,A0.FIRSTNAME,A0.ID FROM PERSON > > A0,PERSON_PROJECT WHERE (PERSON_PROJECT.PROJECT_ID IN ( '2' , '7' )) AND > > A0.ID = PERSON_PROJECT.PERSON_ID > > > > the second query (alias is missing) retrieves mn-implementors: > > > > SELECT DISTINCT PROJECT_ID,PERSON_ID FROM PERSON A0,PERSON_PROJECT WHERE > > (PERSON_PROJECT.PROJECT_ID IN ( '2' , '7' )) AND A0.ID = > > PERSON_PROJECT.PERSON_ID > > > > i'll fix it asap. > > > > jakob > > > > Leandro Rodrigo Saad Cruz wrote: > > > >> Ok.. thanks Jakob > >> > >> On Wed, 2004-01-21 at 12:40, "Jakob Br�uchi" wrote: > >> > >>> hi leandro, > >>> > >>> the mn-prefetcher is quite new. and it never supported aliases ;) > >>> i�m at the oop2004 in munich right now; so i�ll have a look at the > >>> problem > >>> as soon as i�m at home again. > >>> > >>> jakob > >>> > >>> > >>> > >>>> Hi all. I'm having some problems with mton queries because ojb is not > >>>> creating a sql query using aliases anymore. > >>>> > >>>> Maybe the problem is in > >>>> MtoNCollectionPrefetcher.buildMtoNImplementorQuery() > >>>> > >>>> Do you know if the alias generation was accidentally removed ? > >>>> > >>>> Example query(wrong) : SELECT DISTINCT PROJETO_ID,SERVICO_ID FROM > >>>> SERVICO A0,SERVICO_PROJETO WHERE (SERVICO_PROJETO.PROJETO_ID IN ( > >>>> '12' , > >>>> '2' , '13' )) AND A0.SERVICO_ID = SERVICO_PROJETO.SERVICO_ID > >>>> > >>>> Causes my database to yeild with : > >>>> org.apache.ojb.broker.PersistenceBrokerSQLException: > >>>> java.sql.SQLException: ERROR: Column reference "servico_id" is > >>>> ambiguous > >>>> > >>>> Because servico_id is present on both tables, servico and > >>>> servico_projeto > >>>> > >>>> -- > >>>> Leandro Rodrigo Saad Cruz > >>>> IT - Inter Business Tecnologia e Servicos (IB) > >>>> http://www.ibnetwork.com.br > >>>> http://db.apache.org/ojb > >>>> http://xingu.sourceforge.net > >>>> > >>>> > >>>> > >>>> --------------------------------------------------------------------- > >>>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > >>>> For additional commands, e-mail: ojb-dev-help@db.apache.org > >>>> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > > For additional commands, e-mail: ojb-dev-help@db.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-dev-help@db.apache.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org