hibernate3 查询指定字段

 

DetachedCriteria criteria = getDetachedCriteriaForAllOrder(conditions);

	    ProjectionList projectionList = Projections.projectionList();
	    
	    projectionList.add(Projections.distinct(Projections.property("orderId")));
	    projectionList.add(Projections.property("goodsPackfreshFee"));
	    projectionList.add(Projections.property("goodsCallFee"));
	    
	    criteria.setProjection(projectionList);
	    List countList = getHibernateTemplate().findByCriteria(criteria);

你可能感兴趣的:(hibernate3)