java - Hibernate Criteria - Novice Question II -
what best way add sql select part of criteria object?
(i want add select myfunction distance can later order distance)
cheers, rob
from hibernate documentation:
list results = session.createcriteria(cat.class) .setprojection( projections.projectionlist() .add( projections.rowcount(), "catcountbycolor" ) .add( projections.avg("weight"), "avgweight" ) .add( projections.max("weight"), "maxweight" ) .add( projections.groupproperty("color"), "color" ) ) .addorder( order.desc("catcountbycolor") ) .addorder( order.desc("avgweight") ) .list();
Comments
Post a Comment