I am trying to get the rows created/modified one hour back by using the following SQL query for oracle database
select * from filecontent where row_mod_dt <= sysdate-1/24 order by row_mod_dt desc;
I am trying to implement the same in our java application by using the following hibernate named query
@NamedQuery(name="FileContent.findsent",query="select id from filecontent c where c.rowmoddt <= current_date - 1/24")
But it is not giving the expected data.
Please help me with this.
Thanks,
osama yaccoub :
you must use the identification variable c to refer to entity attributes ... and the entity name in the from not the table: \nquery=\"select c from YourEntityName c where c.rowmoddt <= current_date - 1/24 orderby c.rowmoddt desc\"",
2018-02-21T11:28:11