我需要创建类似于
的标准select obj, obj.prop.id from Object1 obj group by obj.prop.id
怎么做?
答案 0 :(得分:3)
List results = session.createCriteria(Cat.class)
.setProjection( Projections.projectionList()
.add( Projections.rowCount() )
.add( Projections.avg("weight") )
.add( Projections.max("weight") )
.add( Projections.groupProperty("color") )
)
.list();