ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: ResultMap composite key problem
Date Thu, 19 May 2005 03:48:41 GMT
That is terribly strange. We have a unit test confirming proper parsing....I 
wonder if the space is giving you trouble?

Ours looks like this:

<result property="favouriteLineItem"
column="{orderId=ORD_ID,lineId=ORD_FAVOURITE_LINE}"
select="getSpecificLineItem"/>

Try removing the space.

Clinton

On 5/18/05, Stuart Piltch <stuart@gradientblue.com> wrote:
> 
> 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
> org.apache.commons.dbcp.DelegatingResultSet.getInt(
> DelegatingResultSet.java:236)
> at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.
> java:25) at java.lang.reflect.Method.invoke(Method.java:324) at
> com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(
> ResultSetLogProxy.java:
> 47) at $Proxy7.getInt(Unknown Source) at
> com.ibatis.sqlmap.engine.type.IntegerTypeHandler.getResult
> (IntegerTypeHandler.
> java:35) at
> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.
> preparePrimitiveParameterObject(BasicResultMap.java:457) at
> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.
> getNestedSelectMappingValue(BasicResultMap.java:411) at
> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults
> (BasicResultMap
> .java:300) at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(
> SqlExecutor.java:
> 363) at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(
> SqlExecutor.java:184
> ) ...
> 
> 
> Cheers,
> 
> - stuart
> 
>

Mime
View raw message