I had those kinds of problem when I didn't have a normal getter and setter for a property in my class.
Check the getters and setters called by your CPL.readArticles_Result and getColor_Result maps and check if the setter are like this one. public void setProperty(Object o) { this.property = o; } public Object getProperty() { return this.property; } -----Original Message----- From: Torsten Michelmann [mailto:[EMAIL PROTECTED] Sent: Monday, 08 May 2006 10:39 To: user-java@ibatis.apache.org Cc: [EMAIL PROTECTED] Subject: Re: AW: Problem with complex properties mapping Hi Michael, I tried to implement your suggestion and it seems that I am now on the next level of the problem. Hi I followed your suggestion as follows: <parameterMap id="prefColorsParams" class="java.util.HashMap"> <parameter property ="finr" /> <parameter property ="sais" /> <parameter property ="koll" /> <parameter property ="form" /> <parameter property ="arnr" /> </parameterMap> <select id="getColorForArticle" parameterMap="prefColorsParams" resultMap="getColor_Result"> now I get com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in so/global/persistence/map/pdm/SqlMap.xml. --- The error occurred while applying a result map. --- Check the CPL.readArticles_Result. --- The error happened while setting a property on the result object. --- Cause: com.ibatis.common.beans.ProbeException: Could not set property 'articleColoursList' for so.global.persistence.map.pdm.ArticleMapper. Cause: com.ibatis.common.exception.NestedRuntimeException: Error lazy loading result. Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in so/global/persistence/map/pdm/Tobas_SqlMap.xml. --- The error occurred while executing query. --- Check the select distinct a.fbnr fbnr, case when a.fbez = '' then b.fbez else a.fbez end fbez from sodta.bavfsl a left outer join sodta.bavfnl b on a.finr=b.finr and a.sais=b.sais and a.koll=b.koll and a.fbnr=b.fbnr where a.finr=#finr# and a.sais=#sais# and a.koll=#koll# and a.form=#form# and a.vacp='' and a.arnr=#arnr# and a.glkz='A' order by fbnr . --- Check the SQL Statement (preparation failed). --- Cause: java.sql.SQLException: [SQL0206] Spalte #FINR# nicht in angegebenen Tabellen. which looks like a problem with the database, but when I run the query manually against the DB it works. I am quite irritated by the statement that the colum #FINR# does not exist as #FINR# is an attribute and not a table in the SQL. When using $$ I can see that finr is replaced by 010 which should be ok. Any new ideas? Greetings Torsten > --- Ursprüngliche Nachricht --- > Von: "Michal Bartmanski" <[EMAIL PROTECTED]> > An: <user-java@ibatis.apache.org> > Betreff: AW: Problem with complex properties mapping > Datum: Mon, 8 May 2006 12:12:06 +0200 > > Hi Torsten, > > i thnk you're missing a parameterMap or parameterClass attribute in > getColorForArticle statement. > > gruss > michal > > > -----Ursprüngliche Nachricht----- > Von: Torsten Michelmann [mailto:[EMAIL PROTECTED] > Gesendet: Montag, 8. Mai 2006 11:55 > An: user-java@ibatis.apache.org > Betreff: Problem with complex properties mapping > > > Hi, > > I am new to DataMapper and it might be that my problem is rather easy > to spot so please bear with me if the problem is trivial but I was not > able to solve it for a few days now and I would be glad for any help. > > I am running queries against an AS/400 using > com.ibm.as400.access.AS400JDBCDriver > > The error message that I get is > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in so/global/persistence/map/pdm/Tobas_SqlMap.xml. > --- The error occurred while applying a parameter map. > --- Check the getColorForArticle-InlineParameterMap. > --- Check the parameter mapping for the 'sais' property. > --- Cause: java.lang.ArrayIndexOutOfBoundsException: 1 Caused by: > java.lang.ArrayIndexOutOfBoundsException: 1 > at > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188) > at > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123) > at > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610) > at > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584) > at > com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101) > at > com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78) > > And the mapping looks like > > <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE sqlMap PUBLIC > "-//iBATIS.com//DTD SQL Map 2.0//EN" > "http://www.ibatis.com/dtd/sql-map-2.dtd"> > > <sqlMap namespace="MyApp"> > <resultMap id="readArticles_Result" class="Article"> > <result property="articleKey.articleId" column="articleid" /> > <result property="articleName" column="fobz" /> > <result property="formGroupKey.formGroupId" column="fogr" /> > <result property="articleColoursList" > > column="{finr=finr,sais=sais,koll=koll,form=form,arnr=arnr}" > select="getColorForArticle" /> > </resultMap> > <resultMap id="getColor_Result" class="ArticleColourBase"> > <result property="articleColourKey.articleColourId" > column="fbnr" /> > <result property="label" column="fbez" /> > </resultMap> > > <select id="readArticlesByCollection" parameterClass="CollectionKey" > resultMap="readArticles_Result"> > <![CDATA[ > select distinct a.koll concat '.' concat a.sais concat '.' > concat > substr(a.form, 3) concat '.' concat substr(a.arnr, 3) articleid , a.sais > sais, a.koll koll , a.form form, a.arnr arnr, a.fogr fogr, a.finr > finr, a.fobz fobz > from sodta.bavksl a > where > a.finr= (select distinct finr from sodta.bckollp where finr<= > '060' > and sgmt=#segmentId# and glkz='J' ) > and ( a.sais= #seasonId# or sais ='899') and a.koll in > (select koll > from > sodta.bckollp where finr<= '060' > and sgmt=#segmentId# and glkz='J' ) and a.glkz='A' > order by articleid > ]]> > </select> > > <select id="getColorForArticle" resultMap="getColor_Result"> > <![CDATA[ > select distinct a.fbnr fbnr, > case when a.fbez = '' > then b.fbez else a.fbez end fbez > from sodta.bavfsl a left outer join sodta.bavfnl b > on a.finr=b.finr > and a.sais=b.sais and a.koll=b.koll and a.fbnr=b.fbnr > where a.finr = #finr# and a.sais = #sais# and a.koll = #koll# > and > a.form = #form# and a.vacp='' and a.arnr= #arnr# > and a.glkz='A' order by fbnr > ]]> > </select> > </sqlMap> > > I have experimented with the parameter sequence of > <result property="articleColoursList" > column="{finr=finr,sais=sais,koll=koll,form=form,arnr=arnr}" > select="getColorForArticle" /> but this did not yield any results. > A test of complex properties mapping using a simple data setup was > successful, so I am now out of ideas. > Any help would be appreciated. > > Greetings > Torsten > > -- > Greetings > Torsten > > "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... > Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail > -- Gruß Torsten Michelmann "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail