From: <one...@us...> - 2002-11-22 07:03:10
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv5673/hibernate/test Modified Files: FooBarTest.java Log Message: experimental support for scalar selects in find() Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v retrieving revision 1.225 retrieving revision 1.226 diff -C2 -d -r1.225 -r1.226 *** FooBarTest.java 21 Nov 2002 07:51:18 -0000 1.225 --- FooBarTest.java 22 Nov 2002 07:03:07 -0000 1.226 *************** *** 828,831 **** --- 828,846 ---- assertTrue( !rs.hasNext() ); + list = s.find("select foo.long, foo.component.name, foo, foo.foo from foo in class Foo"); + rs = list.iterator(); + int count=0; + while ( rs.hasNext() ) { + count++; + Object[] row = (Object[]) rs.next(); + assertTrue( row[0] instanceof Long ); + assertTrue( row[1] instanceof String ); + assertTrue( row[2] instanceof Foo ); + assertTrue( row[3] instanceof Foo ); + } + assertTrue(count!=0); + list = s.find("select avg(foo.long), max(foo.component.name), count(distinct foo.id) from foo in class Foo"); + //s.find("select foo.long, foo.component, foo, foo.foo from foo in class Foo"); //TODO: make this work! + s.save( new Holder("ice T") ); s.save( new Holder("ice cube") ); |