请参阅 在HQL中执行日期/时间数学运算? 举个例子
要使用自定义sql,您必须编写自己的hibernate方言并注册:
registerFunction("weekday", new SQLFunctionTemplate(Hibernate.INTEGER, "to_char(?1,'D')") );
请参阅 在HQL中执行日期/时间数学运算? 举个例子
要使用自定义sql,您必须编写自己的hibernate方言并注册:
registerFunction("weekday", new SQLFunctionTemplate(Hibernate.INTEGER, "to_char(?1,'D')") );