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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -