错误
在实体类中使用了LoalDateTime
package com.deng.pojo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.springframework.context.annotation.ComponentScan;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
@lombok.Data
@AllArgsConstructor
@NoArgsConstructor
public class UserMessage implements Serializable {
@TableId(value = "userid" )
private String userid;
private String name;
@TableField(value = "student_number")
private String studentNumber;
private String address;
private String qq;
private String phone;
private String wechat;
private String email;
private LocalDate birthday; //出生日期
private Integer sex;
@TableLogic //逻辑删除字段
@TableField(fill = FieldFill.INSERT)
private Integer deleted;
@TableField(fill = FieldFill.INSERT)
private Integer version;
@TableField(value = "create_time",fill = FieldFill.INSERT)
private LocalDateTime createTime;
@TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
}
错误内容
java.sql.SQLFeatureNotSupportedException
解决方式
- 将druid数据源的版本升级到 1.1.21
- 将Mybatis-plus的版本降到3.1.0或以下
博客指出在实体类中使用LocalDateTime出现错误,给出了解决方式,即把druid数据源版本升级到1.1.21,将Mybatis - plus版本降到3.1.0或以下。
3455





