Addorder method of Hibernate criteria interface: sets the collation of the result set

addOrder(Order order)

Example

Session session = sessionFactory.openSession();  //定义session对象
Criteria criteria = session.createCriteria(TbTopic.class);  //获取Criteria示例
criteria.addOrder(Order.desc("createTime"));  //设置结果集排序顺序
List list = criteria.list();
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>