Hibernate min method: calculate the minimum value of a column
•
Java
min(String propertyName)
Example
Criteria criteria = session.createCriteria(ResultForm.class); //获取Criteria对象 criteria.setProjection(Projections.min("achievement")); //查询achievement列的最小值 double min = (Double)criteria.uniqueResult(); //获取查询结果 System.out.println("最低成绩:"+min);
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
二维码