使用 Hibernate 我想从契约(Contract)表中获取客户 ID,其中入场日期在一个范围内(两个日期之间)。
List clients = session.createQuery("from Contract contract where contrat.datesouscription BETWEEN "+ begindate+" and "+endate).list();
我的查询不起作用。 谢谢
最佳答案
您需要有关日期的报价
List clients = session.createQuery("from Contract contract where contrat.datesouscription BETWEEN '"+begindate+"' and '"+endate+"'").list();
关于java - 获取入院日期在一定范围内的记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22443880/