db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Hofstee <sander.hofs...@topicus.nl>
Subject I think this is the CORRECT fix Re: Column: 'id' in where clause is ambiguous
Date Fri, 31 Jan 2003 15:49:33 GMT
Thanks for the fix, but I think there still was a problem with it.

It should call addEqualToField instead of addEqualToColumn because we want to have column
== value and NOT column == column
I think the code below is the correct fix.

  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvspublic/jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java,v
  retrieving revision 1.118
  diff -u -r1.118 PersistenceBrokerImpl.java
  --- PersistenceBrokerImpl.java 30 Jan 2003 15:16:51 -0000 1.118
  +++ PersistenceBrokerImpl.java 31 Jan 2003 12:48:10 -0000
  @@ -2018,7 +2018,7 @@
           }
           for (int i = 0; i < itemClassFks.length; i++)
           {
  -            criteria.addEqualToColumn(
  +            criteria.addEqualToField(
                       cod.getIndirectionTable() + "." + itemClassFks[i].toString(),
                       refCld.getPkFields()[i].getAttributeName());
           }

Igor.Petrenko@adminteractive.com.ua wrote:

>Index: PersistenceBrokerImpl.java
>===================================================================
>RCS file: /home/cvspublic/jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java,v
>retrieving revision 1.117
>diff -r1.117 PersistenceBrokerImpl.java
>2022,2023c2022,2023
><                     cod.getIndirectionTable() + "." + itemClassFks[i].toString(),
><                     refCld.getPkFields()[i].getAttributeName());
>---
>  
>
>>                    refCld.getPkFields()[i].getAttributeName()),
>>                    cod.getIndirectionTable() + "." + itemClassFks[i].toString());
>>    
>>
>
>
>-----Original Message-----
>From: Sander Hofstee [mailto:sander.hofstee@topicus.nl]
>Sent: Thursday, January 30, 2003 5:10 PM
>To: OJB Developers List
>Subject: Column: 'id' in where clause is ambiguous
>
>
>Sorry, put it in the wrong thread.
>
>I downloaded the latest CVS version of ojb and tried to make this work.
>But when I try to load an object with an indirection table  I get an error:
>General error: Column: 'id' in where clause is ambiguous
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: ojb-dev-help@jakarta.apache.org
>
>  
>



Mime
View raw message