org.hibernate.QueryException: could not resolve property

org.hibernate.QueryException: could not resolve property error solution

This exception occurs mostly because we are confusing the use of HQL and SQL statements. Because Hibernate uses hql syntax, and sql syntax is different from it. Of course, this is rarely the case when the fields added to the table are the same as those mapped to the attribute fields in the hbm.xml file.
For example, if the ID is a field of the table, then it is also the ID in the hbm.xml file, so there will be no problem when searching. However, the field added to my table is Person_Name, then it may be personName in the hbm.xml file, so everyone should pay attention when using the field, otherwise there will be an exception of org.hibernate.QueryException: could not resolve.

Note: Only the fields in hql are consistent with the field attributes in the entity class

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325148221&siteId=291194637