views:

45

answers:

0

I am using the Projections.rowCount() function on Hibernate, but it will only return the counts greater than 0. I need to get the list with the 0 count too.

This is the function supposed to give me the count but it only returns counts greater than 1.

public List<Object[]> getCuentaPorEnlotar() {
    DetachedCriteria criteria = casosEstadoCriteria(Caso.EstadoOperativo.COMPLETADO, Caso.EstadoAdministrativo.TARIFICADO);
    criteria.add(Restrictions.isNull("lote"));
    criteria.setProjection(Projections.projectionList()
            .add(Projections.groupProperty("cliente"))
            .add(Projections.rowCount()));
    criteria.addOrder(Order.desc("cliente"));
    return (List<Object[]>) getHibernateTemplate().findByCriteria(criteria);
}