assertTrue( "Incorrect result size", iter.hasNext() );
obj = iter.next();
assertTrue( "Incorrect return type", obj instanceof Map );
assertEquals( "Incorrect return type", ( (Map) obj ).size(), 2 );
ScrollableResults sr = session.createQuery( "select new map(an.description, an.bodyWeight) from Animal an" ).scroll();
assertTrue( "Incorrect result size", sr.next() );
obj = sr.get(0);
assertTrue( "Incorrect return type", obj instanceof Map );
assertEquals( "Incorrect return type", ( (Map) obj ).size(), 2 );
sr.close();
sr = session.createQuery( "select new Animal(an.description, an.bodyWeight) from Animal an" ).scroll();
assertTrue( "Incorrect result size", sr.next() );
assertTrue( "Incorrect return type", sr.get(0) instanceof Animal );
sr.close();
// caching...
QueryStatistics stats = getSessions().getStatistics().getQueryStatistics( "select new Animal(an.description, an.bodyWeight) from Animal an" );
results = session.createQuery( "select new Animal(an.description, an.bodyWeight) from Animal an" )
.setCacheable( true )