有下列实体类:
@Data
@Table(name = "doctors_doctor")
@NoArgsConstructor
public class Doctor implements Serializable {
@Id
private Integer id;
private String name;
private String sex;
private String idCard;
private String email;
private Long mobile;
private LocalDate birthday;
private String avatar;
private String username;
private String password;
private Boolean isVerified;
private Integer department_id;
private Integer hospital_id;
private Integer title_id;
private Integer ethnic_id;
}
数据库列名:
当外键字段使用驼峰命名时就报错
Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'department_id' of bean class [com.fengyun.medical.pojo.domain.Doctor]: Could not find field for property during fallback access!
有知道原因的大神留言下
来自为知笔记(Wiz)
标签:String,驼峰,Doctor,jpa,spring,private,外键,Integer,id From: https://www.cnblogs.com/baiyifengyun/p/16847139.html