From: <ste...@us...> - 2006-02-16 19:24:22
|
Update of /cvsroot/hibernate/Hibernate3/test/org/hibernate/test/hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15297/test/org/hibernate/test/hql Modified Files: ASTParserLoadingTest.java Log Message: disallow fetches in subqueries Index: ASTParserLoadingTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- ASTParserLoadingTest.java 8 Feb 2006 18:49:26 -0000 1.52 +++ ASTParserLoadingTest.java 16 Feb 2006 19:24:13 -0000 1.53 @@ -67,6 +67,18 @@ }; } + public void testFetchInSubqueryFails() { + Session s = openSession(); + try { + s.createQuery( "from Animal a where a.mother in (select m from Animal a1 inner join a1.mother as m join fetch m.mother)" ).list(); + fail( "fetch join allowed in subquery" ); + } + catch( QueryException expected ) { + // expected behavior + } + s.close(); + } + public void testQueryMetadataRetrievalWithFetching() { // HHH-1464 : there was a problem due to the fact they we polled // the shallow version of the query plan to get the metadata. |