Hibernate:**not found while looking for property: id https://blog.csdn.net/weixin_43827144/article/details/88935334

https://blog.csdn.net/weixin_43827144/article/details/88935334

在程序执行时可能会报找不到属性的错误:
例如:class Student not found while looking for property: id

1. 是否写包名


2. 查看配置文件是否正确配置,是否与数据库中字段对应


3. id值是否正确对应
Hibernate 自带了很多种标识符生成器:

increment 采用 Hibernate 数值递增的方式;
不依赖于底层数据库系统,适合所有数据库;
适合单独的 Hibernate 应用使用,不适合在集群情况下使用
identity 采用数据库提供的自增长方式;
该机制依赖于底层数据库,需要数据库支持自动增长字段

assigned 主键由应用逻辑产生(自然主键);
由外部程序负责生成 OID,Hibernate 不负责维护主键生成,与Hibernate和底层数据库都无关
---------------------
作者:影兮
来源:CSDN
原文:https://blog.csdn.net/weixin_43827144/article/details/88935334
版权声明:本文为博主原创文章,转载请附上博文链接!

原文地址:https://www.cnblogs.com/Jeely/p/11102656.html