I wan to get the value of only one week. I am using the following JPA query:
SELECT a
FROM questions.dao.hibernate.Questions a
WHERE (a.posted_date-CURRENT_DATE)>= 7
But I am getting an error message like
org.hibernate.QueryException: could not resolve property: posted_date of: questions.dao.hibernate.Questions [SELECT a FROM questions.dao.hibernate.Questions a WHERE (a.posted_date-CURRENT_DATE)>=7]
Please help me.
Thanks
This sounds pretty self-explanatory to me. The class
questions.dao.hibernate.Questionsdoes not have a property calledposted_date(it may have the property – that would be a strange naming convention though – but Hibernate doesn’t know it).