You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by tm jee <tm...@yahoo.co.uk> on 2006/08/03 18:35:17 UTC

recognizing {...} syntax in result's column attribute

Hi guys, 

Newbie in webwork, just trying out ibatis with the following sql map configuration (partial). WIth the configuration as follows :-

    <resultMap id="result_personWithInformation" class="testing.ibatis.domain.Person" >
        <result property="id" column="ID" jdbcType="VARCHAR" javaType="java.lang.String" />
        <result property="name" column="NAME" jdbcType="VARCHAR" javaType="java.lang.String"  />
        <result property="age" column="AGE" jdbcType="INTEGER" javaType="java.lang.Integer" />
        <result property="information" column="INFORMATION_ID" select="Person.findInformation" />
    </resultMap>
    
    <statement id="findAllPersonWithInformation" resultMap="result_personWithInformation">
        SELECT 
            p.ID as ID, 
            p.NAME as NAME, 
            p.AGE as AGE,
            p.INFORMATION_ID as INFORMATION_ID
        FROM 
            person as p
    </statement> 

If I want to pass two arguments into the select with id "Person.findInformation", is it correct to change line

<result property="information" column="INFORMATION_ID" select="Person.findInformation" />

to

<result property="information" column="{INFORMATION_ID, NAME}" select="Person.findInformation" />

I've came across this in the docs under section "Composite keys or complex parameters properties". With the above mentioned line replaced, ibatis seems to be giving me

Column '{INFORMATION_ID, NAME}' not found.


Am I doing it wrongly?

Thanks in advance.