From: <one...@us...> - 2002-12-28 02:25:51
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv21213/cirrus/hibernate/test Modified Files: SQLFunctionsTest.java FooBarTest.java Log Message: added support for <joined-subclass> to CodeGenerator added Query.getNamedParameters(), Query.setProperties() fixed a bug in Query.getReturnTypes() Index: SQLFunctionsTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/SQLFunctionsTest.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** SQLFunctionsTest.java 27 Dec 2002 11:54:47 -0000 1.35 --- SQLFunctionsTest.java 28 Dec 2002 02:25:48 -0000 1.36 *************** *** 20,23 **** --- 20,37 ---- } + public void testSetProperties() throws Exception { + Session s = sessions.openSession(); + Transaction t = s.beginTransaction(); + Simple simple = new Simple(); + simple.setName("Simple 1"); + s.save(simple, new Long(10) ); + Query q = s.createQuery("from s in class Simple where s.name=:name and s.count=:count"); + q.setProperties(simple); + assertTrue( q.list().get(0)==simple ); + s.delete(simple); + t.commit(); + s.close(); + } + public void testSQLFunctions() throws Exception { Session s = sessions.openSession(); Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v retrieving revision 1.236 retrieving revision 1.237 diff -C2 -d -r1.236 -r1.237 *** FooBarTest.java 27 Dec 2002 11:54:47 -0000 1.236 --- FooBarTest.java 28 Dec 2002 02:25:48 -0000 1.237 *************** *** 911,914 **** --- 911,918 ---- assertTrue( s.find("from n0 in class Named, n1 in class Named where n0.name = n1.name").size()==7 ); + Query qu = s.createQuery("from n in class Named where n.name = :name"); + qu.getReturnTypes(); + qu.getNamedParameters(); + iter = s.iterate("from o in class java.lang.Object"); int c = 0; *************** *** 1608,1612 **** s.save( new Foo() ); s.save( new Bar() ); ! ScrollableResults iter = s.createQuery("select f, f.integer from f in class Foo").scroll(); assertTrue( iter.next() ); assertTrue( iter.scroll(1) ); --- 1612,1618 ---- s.save( new Foo() ); s.save( new Bar() ); ! Query query = s.createQuery("select f, f.integer from f in class Foo"); ! assertTrue( query.getReturnTypes().length==2 ); ! ScrollableResults iter = query.scroll(); assertTrue( iter.next() ); assertTrue( iter.scroll(1) ); |