Ok, i have determined that the problem is not with Projections.rowCount.
The problems seems to be with sql with paramters.
This took over 4 mintues to complete!
String sql = "select count(*) as y0_ from SOME_TABLE this_ where this_.SOME_ID> :some_id";
List b = getCurrentSession().createSQLQuery(sql).addScalar("y0_", new BigDecimalType()).
setInteger("some_id", 100).list();
while this finished in 20 seconds.
String sql = "select count(*) as y0_ from SOME_TABLE this_ where this_.SOME_ID> 100";
List b = getCurrentSession().createSQLQuery(sql).addScalar("y0_", new BigDecimalType())
.list();
Doing a search i have found similar problems:
http://forum.hibernate.org/viewtopic.ph ... meter+slow
But I have not found any satisfactory answers. Anyone have any ideas?
-Lily Changstein