如何获得比“休眠-条件查询”更高的记录?

时间:2019-01-21 15:50:42

标签: java spring hibernate criteria hibernate-criteria

金额值为Big Decimal类型,逻辑应为 _customerPayeeTransaction.getAmount()> 10 000.00

如何更改以下条件以符合上述逻辑?

Criterion amount = Restrictions.gt("cpt.amount", _customerPayeeTransaction.getAmount());

请帮助我。

1 个答案:

答案 0 :(得分:2)

If u want to add filter amount lower than 10 000 : 

Criterion amount = Restrictions.lt("cpt.amount", new BigDecimal("10000.00"));