Spring Boot JPA问题:could not read a hi value

Spring Boot JPA问题:could not read a hi value

问题

could not read a hi value

解决办法

查看工程中数据库实体类的注解

@Entity
@Data
@Table(name = "user")
public class User {

    @Id
    @GeneratedValue 
    private Long id;
    private Integer age;
    private String name;
    @Column(name = "create_time")
    private Date createTime;

}

修改注解:

@GeneratedValue

@GeneratedValue(strategy = GenerationType.AUTO)

改为:

@GeneratedValue(strategy = GenerationType.IDENTITY)

修改后的结果:

@Entity
@Data
@Table(name = "user")
public class User {

    @Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private Integer age;
    private String name;
    @Column(name = "create_time")
    private Date createTime;

}

重启,问题解决。

你可能感兴趣的:(Spring,Boot)