Thanks for reply.
I am using HQL.
I have implemented below code :
String searchQuery = "..........
and date_sub_interval(curdate(), 28, DAY ) < b_date and
........";
(where b_date is table filed).
class Dialect extends MySQLInnoDBDialect {
public Dialect() {
super();
registerFunction("date_sub_interval", new SQLFunctionTemplate(
Hibernate.DATE, "date_sub(?1, INTERVAL ?2 ?3)"));
}
}
In above code i am getting error. I am not sure whether above code is correct or not.
Error says:
'DAY' field not found.
I haven't done any other configurations. I have implemented hibernate code using EntityManager and annotations based api.
|