db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Kowalczyk" <steph...@cooper-software.com>
Subject Oracle, Criteria and joins
Date Fri, 13 Dec 2002 02:18:11 GMT
I'm having some trouble with Oracle, Criteria and table joins.  My code works fine against
mysql, but when I try to use Oracle I get an exception.  This is using the newly released
Torque 3.0 against Oracle 9 using the classes12.zip thin driver.  

In my code, I create a criteria:

CRITERIA.addSelectColumn(RegistrationPeer.REGISTRATIONID);
CRITERIA.addSelectColumn(AuthMapPeer.PARTNUMBER);
CRITERIA.addJoin(RegistrationPeer.AUTHCODE, AuthMapPeer.AUTHCODE);

Then I use the BasePeer to retrieve results and loop over them:

List resultList = BasePeer.doSelect(CRITERIA);

for (int i=0; i<resultList.size(); i++) {
   Record row = (Record) resultList.get(i);
   row.getValue(RegistrationPeer.REGISTRATIONID)
}

This code throw an exception:

com.workingdogs.village.DataSetException: Column name: REGISTRATIONID does not exist!

The value of RegistrationPeer.REGISTRATIONID is "Registration.REGISTRATIONID".  Looking at
the schema from
row.schema(), I see that the column name is "REGISTRATIONID" (no tablename appended).

I'm guessing that either I need to configure Oracle somehow or use the criteria/join differently.
 That, or the com.workingdogs.village stuff has a bug.

Anyone have any suggestions/ideas?

Thanks,

Stephen



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message