Addorder method of Hibernate criteria interface: sets the collation of the result set
•
Java
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
二维码