当项目中集成Spring data JPA 或者hibernate,如图:

Springboot data JPA 报No property xxx found for type xxx!

运行报No property username found for type Login!错误

原因:

Springboot data JPA 报No property xxx found for type xxx!

我的login  Entity表里没有name字段,而是username,系统会把Springboot data JPA 报No property xxx found for type xxx!红色箭头部分当作实体类的一个属性,所以报错,两者只要一致就可以了。

相关文章: