From: <hib...@li...> - 2006-05-04 11:58:49
|
Author: ste...@jb... Date: 2006-05-04 07:58:42 -0400 (Thu, 04 May 2006) New Revision: 9871 Modified: trunk/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java Log: HHH-1413 : multiple bag fetches Modified: trunk/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java =================================================================== --- trunk/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2006-05-04 11:57:58 UTC (rev 9870) +++ trunk/Hibernate3/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2006-05-04 11:58:42 UTC (rev 9871) @@ -84,6 +84,20 @@ cfg.setProperty( Environment.GENERATE_STATISTICS, "true" ); } + public void testMultipleBagFetchesFail() { + Session s = openSession(); + s.beginTransaction(); + try { + s.createQuery( "from Human h join fetch h.friends f join fetch f.friends fof" ).list(); + fail( "failure expected" ); + } + catch( HibernateException e ) { + assertTrue( "unexpected failure reason : " + e, e.getMessage().indexOf( "multiple bags" ) > 0 ); + } + s.getTransaction().commit(); + s.close(); + } + public void testCollectionJoinsInSubselect() { // HHH-1248 : initially FromElementFactory treated any explicit join // as an implied join so that theta-style joins would always be used. |