db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leandro Rodrigo Saad Cruz <lean...@ibnetwork.com.br>
Subject Aliases on MtoN queries not working anymore
Date Tue, 20 Jan 2004 15:08:36 GMT
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


Mime
View raw message