Hibernate Criteria Order By

后端 未结 3 645
执笔经年
执笔经年 2021-01-04 02:58

I have a table called Gift, which has a one-to-many relationship to a table called ClickThrough - which indicates how many times that particular Gift has been clicked. I nee

3条回答
  •  温柔的废话
    2021-01-04 03:13

    Note for anyone else that comes through here looking to order by a property/column:

    When using the approaches mentioned here, no results were found. The fix was to use criteria.addOrder(Order.asc(property)); instead. Notice the difference is to use addOrder, rather than add;

    I've had this issue several times after running here for a quick reference.

提交回复
热议问题