ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hermit Geek <HermitG...@yahoo.com>
Subject Composite key problems in column attribute (again)
Date Tue, 16 Mar 2010 23:12:04 GMT

I know this has been addressed before but it's still not working for me.

I'm developing an application pro bono for the local community college. It
was mostly working in Ibatis 2 and then when I migrated to 3, my composite
keys would no longer work. I'm currently in Ibatis 3, beta 10. Below is a
portion of my mapper file. The collection property works as expected with a
single parameter (autoID) and a hard coded second parameter for the
composite key as indicated below in the resultMap.

<resultMap id="dsrcStudentResult"    type="studentData" >
        <id property="autoID"                 column="autoid" />
        <result property="activeSemester"    column="activeSemester"/>
        <result property="studentID"        column="studentID"/>
        <result property="lastName"            column="lastname"/>
        <result property="firstName"        column="firstname"/>
        <collection property="disabilityList" javaType="ArrayList"
            column="autoID" select="getDisabilityList" />
     <select id="getDisabilityList"  resultType="java.lang.String">
        SELECT specificdisabilityfkey
             FROM joinDsrcStudentDisability
             WHERE joinDsrcStudentDisability.dsrcStudentFKey = #{id}
             AND semesterFKey = '20081'

    <select id="getStudentByAutoID" parameterType="studentQueryParam"
resultMap="dsrcStudentResult" >
        SELECT *, #{activeSemester} AS activeSemester   
        FROM dsrcStudent
        WHERE dsrcStudent.autoID = #{autoID}

I changed the column attribute to accommodate composite keys and substitute
the hard coded semesterFKey parameter with #{semester}


        SELECT specificdisabilityfkey
             FROM joinDsrcStudentDisability
             WHERE joinDsrcStudentDisability.dsrcStudentFKey = #{id}
             AND semesterFKey = #{semester}

When the program executes, I get the following error:

### Error querying database.  Cause:
org.apache.ibatis.reflection.ReflectionException: There is no setter for
property named 'autoID' in 'class java.lang.Object'
### The error may involve dsrcdata.getStudentByAutoID-Inline
### The error occurred while setting parameters

Am I doing something wrong, or should I wait for a later release?
Thanks for the help,
James Templer
View this message in context: http://old.nabble.com/Composite-key-problems-in-column-attribute-%28again%29-tp27925843p27925843.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message