Hi All,
I was wondering if batch update is possible in iBatis.
I have a bean TableList which I would like to update
TableList
private java.lang.String dbName;
private com.students.vo.Table[] tables;
Table
private int studentId;
private int class;
private java.lang.String studentName;
private java.lang.String classTeacher;
private com.students.vo.Subject[] subjects;
My SQLMap file looks like this
<sqlMap namespace="ReplicationData">
<typeAlias alias="tableList" type="com.students.vo.TableList" />
<typeAlias alias="table" type="com.students.vo.Table" />
<typeAlias alias="subject" type="com.students.vo.Subject" />
<update id="updateTable" parameterClass="tableList">
update $dbName$..studentInfo set
<iterate property="tables">
StudentId=#tables[].studentId# where
name=#tables[].studentName#
classInCharge=#tables[].classTeacher#
</iterate>
</update>
</sqlMap>
But whenever i execute my query, I get the following error
2006-01-09 19:27:23,210 +0530 ERROR [EDSUtils][http-8080-Processor24] - throwEDSFault
com.ibatis.dao.client.DaoException: Failed to update - id
[updateTableMetaData] - parameterObject
[EMAIL PROTECTED] Cause:
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/students/dao/datamap/sql/ReplicationConfiguration.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the updateTable.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: Error getting
ordinal list from JavaBean. Cause java.lang.NumberFormatException: For
input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""
Caused by: com.ibatis.common.beans.ProbeException: Error getting
ordinal list from JavaBean. Cause java.lang.NumberFormatException: For
input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/students/dao/datamap/sql/ReplicationConfiguration.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the updateTable.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: Error getting
ordinal list from JavaBean. Cause java.lang.NumberFormatException: For
input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""
Caused by: com.ibatis.common.beans.ProbeException: Error getting
ordinal list from JavaBean. Cause java.lang.NumberFormatException: For
input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""
at com.ibatis.dao.client.template.SqlMapDaoTemplate.update(SqlMapDaoTemplate.java:124)
at
com.students.datamap.ReplicationConfigurationSqlMapDao.updateTables(ReplicationConfigurationSqlMapDao.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:64)
at $Proxy1.updateTables(Unknown Source)
....
....
Can anyone tell me wht's that I am doing wrong??
--
Thanks,
Sathish S
