From: <one...@us...> - 2002-11-14 11:28:58
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory usw-pr-cvs1:/tmp/cvs-serv27942/hibernate/test Modified Files: FooBarTest.java SQLFunctionsTest.java Log Message: undeprecated update() fixed BAD bug in generated SQL from some queries support multi-argument SQL functions Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v retrieving revision 1.219 retrieving revision 1.220 diff -C2 -d -r1.219 -r1.220 *** FooBarTest.java 7 Nov 2002 11:33:49 -0000 1.219 --- FooBarTest.java 14 Nov 2002 11:28:55 -0000 1.220 *************** *** 218,221 **** --- 218,224 ---- public void testPersistCollections() throws Exception { Session s = sessions.openSession(); + + assertTrue( s.iterate("select count(*) from b in class Bar").next().equals( new Integer(0) ) ); + Baz baz = new Baz(); s.save(baz); *************** *** 698,701 **** --- 701,713 ---- s.save(foo2); foo.setFoo(foo2); + + if ( dialect instanceof DB2Dialect) { + s.find("from foo in class Foo where lower( foo.foo.string ) = 'foo'"); + s.find("from foo in class Foo where lower( (foo.foo.string || 'foo') || 'bar' ) = 'foo'"); + s.find("from foo in class Foo where repeat( (foo.foo.string || 'foo') || 'bar', 2 ) = 'foo'"); + s.find("from foo in class Bar where foo.foo.integer is not null and repeat( (foo.foo.string || 'foo') || 'bar', (5+5)/2 ) = 'foo'"); + s.find("from foo in class Bar where foo.foo.integer is not null or repeat( (foo.foo.string || 'foo') || 'bar', (5+5)/2 ) = 'foo'"); + } + List list = s.find("from foo in class cirrus.hibernate.test.Foo where foo.string='osama bin laden' and foo.boolean = true order by foo.string asc, foo.component.count desc"); assertTrue( list.size()==0, "empty query" ); Index: SQLFunctionsTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/SQLFunctionsTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** SQLFunctionsTest.java 5 Nov 2002 07:09:14 -0000 1.30 --- SQLFunctionsTest.java 14 Nov 2002 11:28:55 -0000 1.31 *************** *** 6,9 **** --- 6,10 ---- import cirrus.hibernate.*; + import cirrus.hibernate.sql.DB2Dialect; import cirrus.hibernate.sql.MySQLDialect; import cirrus.hibernate.sql.SAPDBDialect; *************** *** 25,28 **** --- 26,36 ---- simple.setName("Simple 1"); s.save(simple, new Long(10) ); + + if ( dialect instanceof DB2Dialect) { + s.find("from s in class Simple where repeat('foo', 3) = 'foofoofoo'"); + s.find("from s in class Simple where repeat(s.name, 3) = 'foofoofoo'"); + s.find("from s in class Simple where repeat( lower(s.name), 3 + (1-1) / 2) = 'foofoofoo'"); + } + assertTrue( s.find("from s in class Simple where upper( s.name ) ='SIMPLE 1'").size()==1 *************** *** 37,42 **** s.find("from s in class Simple where lower( s.name + ' foo' ) ='simple 1 foo'").size()==1 ); ! } ! Simple other = new Simple(); --- 45,49 ---- s.find("from s in class Simple where lower( s.name + ' foo' ) ='simple 1 foo'").size()==1 ); ! } Simple other = new Simple(); |