views:

81

answers:

1

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

+2  A: 

This sounds pretty self-explanatory to me. The class questions.dao.hibernate.Questions does not have a property called posted_date (it may have the property - that would be a strange naming convention though - but Hibernate doesn't know it).

Pascal Thivent