mybatis 报错:无效的列类型: 1111
场景
数据库:oracle
在使用mapper.xml进行 insert 的时候,传入了null值。
原因
jdbcType对应关系错误
<resultMap type="XXX" id="UserActivationStatisticsMap">
<result property="id" column="ID" jdbcType="INTEGER"/>
<result property="createDate" column="CREATE_DATE" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
<result property="dailyActiveUserNum" column="DAILY_ACTIVE_USER_NUM" jdbcType="INTEGER"/>
<result property="monthlyActiveUserNum" column="MONTHLY_ACTIVE_USER_NUM" jdbcType="INTEGER"/>
<result property="totalRegistrations" column="TOTAL_REGISTRATIONS" jdbcType="INTEGER"/>
<result property="newRegistrationsYesterday" column="NEW_REGISTRATIONS_YESTERDAY" jdbcType="INTEGER"/>
<result property="newRegistrationsThisMonth" column="NEW_REGISTRATIONS_THIS_MONTH" jdbcType="INTEGER"/>
<result property="yesterdayLogoutNum" column="YESTERDAY_LOGOUT_NUM" jdbcType="INTEGER"/>
<result property="dailyActiveDegree" column="DAILY_ACTIVE_DEGREE" jdbcType="INTEGER"/>
<result property="signInGroup" column="SIGN_IN_GROUP" jdbcType="VARCHAR"/>
<result property="activeGroup" column="ACTIVE_GROUP" jdbcType="VARCHAR"/>
<result property="visitDegreeGroup" column="VISIT_DEGREE_GROUP" jdbcType="VARCHAR"/>
<result property="visitPeopleGroup" column="VISIT_PEOPLE_GROUP" jdbcType="VARCHAR"/>
<result property="signOutGroup" column="SIGN_OUT_GROUP" jdbcType="VARCHAR"/>
</resultMap>
解决方式
根据JdbcType 对应表,修改对应的类型。
JdbcType对应关系:https://blog.csdn.net/loongshawn/article/details/50496460