Hi I am trying to insert a list of object through ibatis but i am getting an exception like org.apache.ibatis.mapping.SqlMapperException: The expression 'boxlist' evaluated to a null value.
<insert id="insertList" parameterType="java.util.List">
INSERT INTO boxtable (
size,length)
VALUES
<foreach item="box" collection="boxList" separator=",">
(#{box.size},#{box.length})
</foreach>
</insert>
My dao class is like
public void insert(List<box> boxList)
throws SQLException {
try {
sqlSession = sqlSessionFactory.openSession(AUTO_COMMIT);
int status = sqlSession.insert("insertlist", boxList);
logger.debug("status :: " + status);
sqlSession.commit();
} catch (Throwable ee) {
logger.error("e", ee);
sqlSession.rollback();
} finally {
sqlSession.close();
}
}
Can anyone help me out???