ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Piltch <stu...@gradientblue.com>
Subject ResultMap composite key problem
Date Wed, 18 May 2005 15:32:50 GMT
Hi there,

I recently added some resultMaps with composite keys as described in the
documentation: http://ibatisnet.sourceforge.net/DevGuide/ar01s03.html#d0e1064

I've done this successfully in iBatis before in other projects, but now I keep
getting a jdbc "Column not found" error (see below for some of the stack trace).
I'm using the new iBatis 2.1.0, but I've also tried the past few releases as
well. I've been trying to figure out what is different about this project than
the previous ones (which are still working fine).

Before I start copying and pasting large sections of the xml file, I thought I'd
start with asking if anyone has seen this error and knows what's causing it. If
it would help, I can start posting sections of the xml.

I'm using Mac OS X (10.3.9), Tomcat 5.0.29, MySQL 4.1.7, and iBatis 2.1.0. I've
tried it with lazy loading enabled and disabled and I've tried using a single
named key (eg column="{testId=test_id}") with the same results. It looks like
the {...} isn't being parsed by iBatis before being handed off to jdbc.

The single line that's causing problems is:

<result property="categories" column="{testId=test_id, asmtId=assessment_id}"
select="getCompetencyTypes" />

The error I get is: java.sql.SQLException: Column '{testId=test_id,
asmtId=assessment_id}' not found. at
com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:2317) at
com.mysql.jdbc.ResultSet.getInt(ResultSet.java:1287) at
at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source) at
java:25) at java.lang.reflect.Method.invoke(Method.java:324) at
47) at $Proxy7.getInt(Unknown Source) at
java:35) at
preparePrimitiveParameterObject(BasicResultMap.java:457) at
getNestedSelectMappingValue(BasicResultMap.java:411) at
.java:300) at
363) at
) ...


- stuart

View raw message