我需要使用 Hibernate 从特定月份和年份中提取记录。
我的代码:
if (!Converter.isStringNullOrEmpty(month ) && !Converter.isStringNullOrEmpty(year) ) {
restrictionAnno = Restrictions.eq("year(dtControllo)",month );
restrictionMese = Restrictions.eq("month(dtControllo)",year);
}
这会产生一个休眠异常:
could not resolve property: month(dtControllo) of: it.iet.ortles.hbean.TableauPresenza
如何解决此错误?