Pregunta

I have been trying to solve this one since morning. But i am unable to.

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;

this column is SMALLINT TYPE and NOT NULL.

Getting the below error:

org.hibernate.QueryException: could not resolve property: sync_status .

¿Fue útil?

Solución

In HQL/JPQL, you don't make reference to database column names, you reference property names instead.

Use syncStatus in the query, not sync_status.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top