orcale java.lang.ArrayIndexOutOfBoundsException: 8

插入语句如下

INSERT INTO SYS_USERS ( ID, NAME, PHONE, EMAIL, SEX, AGE, PASSWD, ROLE_ID ) values ( ?, ?, ?, ?, ?, ?, ?, ? ) 

错误信息如下

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error preparing statement.  Cause: java.lang.ArrayIndexOutOfBoundsException: 8

前端传递信息如下。。。。没看懂问题是怎么出的?

clipboard.png

另外service方法如下

    @Override
    public void add(SysUsers user) {
        sysUsersMapper.add(user);
    }

Mapper 代码如下

 <insert id="add">
        INSERT INTO SYS_USERS
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">ID,</if>
            <if test="name != null and name != ''">NAME,</if>
            <if test="phone != null and phone != ''">PHONE,</if>
            <if test="email != null and email != ''">EMAIL,</if>
            <if test="sex != null and sex != ''">SEX,</if>
            <if test="age != null and age != ''">AGE,</if>
            <if test="passwd != null and passwd != ''">PASSWD,</if>
            <if test="roleId != null and roleId != ''">ROLE_ID,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null and id != ''">#{id},</if>
            <if test="name != null and name != ''">#{name},</if>
            <if test="phone != null and phone != ''">#{phone},</if>
            <if test="email != null and email != ''">#{email},</if>
            <if test="sex != null and sex != ''">#{sex},</if>
            <if test="age != null and age != ''">#{age},</if>
            <if test="passwd != null and passwd != ''">#{passwd},</if>
            <if test="roleId != null and roleId != ''">#{roleId},</if>
        </trim>
    </insert>
阅读 5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进