org.hibernate.QueryException:无法解析属性:

org.hibernate.QueryException:无法解析属性:,hibernate,jpql,Hibernate,Jpql,从早上开始我就一直在努力解决这个问题。但是我不能 Query query = em.createQuery("Update ABC p set p.sync_status=14 where p.eventhistoryid in (select c.eventhistoryid from ABC c where c.sync_status=0 and c.receivedtimestamp >= getTimeStampAfterDeductingHours(24)"); ABC e

从早上开始我就一直在努力解决这个问题。但是我不能

Query query = em.createQuery("Update ABC p set p.sync_status=14 where p.eventhistoryid in (select c.eventhistoryid from  ABC c where c.sync_status=0 and c.receivedtimestamp >=  getTimeStampAfterDeductingHours(24)");

ABC entity class contains the below column:  
@Column(name="sync_status")
private short syncStatus = 0;
此列为SMALLINT类型,不为NULL

获取以下错误:

org.hibernate.QueryException:无法解析属性:sync\u状态


在HQL/JPQL中,您不引用数据库列名,而是引用属性名

在查询中使用syncStatus,而不是sync\u status