mybatisplus的this.save()方法报错?

报错信息

 - nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'params'. It was either not specified and/or could not be found for the javaType (java.util.Map) : jdbcType (null) combination.
### The error may exist in com/ruoyi/system/mapper/AccUserCredentialMapper.java (best guess)
### The error may involve com.ruoyi.system.mapper.AccUserCredentialMapper.insert
### The error occurred while executing an update
### Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'params'. It was either not specified and/or could not be found for the javaType (java.util.Map) : jdbcType (null) combination.
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'params'. It was either not specified and/or could not be found for the javaType (java.util.Map) : jdbcType (null) combination.
### The error may exist in com/ruoyi/system/mapper/AccUserCredentialMapper.java (best guess)
### The error may involve com.ruoyi.system.mapper.AccUserCredentialMapper.insert
### The error occurred while executing an update
### Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'params'. It was either not specified and/or could not be found for the javaType (java.util.Map) : jdbcType (null) combination.
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:92)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
    at com.sun.proxy.$Proxy157.insert(Unknown Source)

一般常见原因,是因为实体类的写法错误,识别不来对应的参数字段

  • 修改前实体类
@Data
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName("acc_user_credential")
public class AccUserCredential implements Serializable{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;
    /** 用户ID */
    private Long userId;
    /** 用户登陆类型 1手机号 2微信 3QQ 后面依次类推 */
    private Integer loginType;
    /** 登陆账号 手机号 openid 等 */
    private String loginAccount;
    /** 密码 加密密码 */
    private String credential;
}
  • 修改后的实体类
@Data
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName("acc_user_credential")
public class AccUserCredential implements Serializable{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @TableId(value = "id", type = IdType.INPUT)
    private Long id;
    /** 用户ID */
    private Long userId;
    /** 用户登陆类型 1手机号 2微信 3QQ 后面依次类推 */
    private Integer loginType;
    /** 登陆账号 手机号 openid 等 */
    private String loginAccount;
    /** 密码 加密密码 */
    private String credential;
}

你可能感兴趣的:(mybatisplus的this.save()方法报错?)