HHH-5010 org.hibernate.test.hql.CriteriaHQLAlignmentTest.testCriteriaAggregationReturnType() needs call flush before do the query

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19000 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Strong Liu 2010-03-15 14:16:44 +00:00
parent e0694c871b
commit 97a9f5cd9b
1 changed files with 2 additions and 1 deletions

View File

@ -119,7 +119,8 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
human.setBigIntegerValue( new BigInteger("42") );
human.setBigDecimalValue( new BigDecimal(45) );
s.save(human);
s.flush();
s.clear();
// EJB3: COUNT returns Long
Long longValue = (Long) s.createCriteria( Human.class ).setProjection( Projections.rowCount()).uniqueResult();
assertEquals(longValue, new Long(1));