Author: amarkhel
Date: 2010-01-28 07:14:01 -0500 (Thu, 28 Jan 2010)
New Revision: 16373
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java
Log:
Fix RF-8327
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java 2010-01-28
12:12:56 UTC (rev 16372)
+++
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java 2010-01-28
12:14:01 UTC (rev 16373)
@@ -17,6 +17,7 @@
import org.hibernate.Session;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
+import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.richfaces.model.ExtendedFilterField;
import org.richfaces.model.FilterField;
@@ -144,7 +145,8 @@
public int getRowCount() {
Criteria criteria = createCriteria();
appendFilters(FacesContext.getCurrentInstance(), criteria);
- return (Integer) criteria.list().size();
+ criteria.setProjection(Projections.rowCount());
+ return ((Integer)criteria.list().get(0)).intValue();
}
@Override
Show replies by date