From: Michael D. <mik...@us...> - 2004-07-01 12:53:26
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17192/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Added test for exists and size for hql Fixed BasicBinaryFixture error that feilng pointed out on forum. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** FooBarTest.cs 30 Jun 2004 18:27:07 -0000 1.33 --- FooBarTest.cs 1 Jul 2004 12:53:14 -0000 1.34 *************** *** 795,801 **** [Test] - [Ignore("Test not written yet.")] public void CompositeKeyPathExpressions() { } --- 795,825 ---- [Test] public void CompositeKeyPathExpressions() { + ISession s = sessions.OpenSession(); + + string hql = "select fum1.Fo from fum1 in class Fum where fum1.Fo.FumString is not null"; + s.Find(hql); + + hql = "from fum1 in class Fum where fum1.Fo.FumString is not null order by fum1.Fo.FumString"; + s.Find(hql); + // TODO: in h2.0.3 there is also HQSLDialect, MckoiDialect, and PointbaseDialect + if(!(dialect is Dialect.MySQLDialect)) + { + hql = "from fum1 in class Fum where exists elements(fum1.Friends)"; + s.Find(hql); + + hql = "from fum1 in class Fum where size(fum1.Friends) = 0"; + s.Find(hql); + } + + hql = "select fum1.Friends.elements from fum1 in class Fum"; + s.Find(hql); + + hql = "from fum1 in class Fum, fr in elements( fum1.Friends )"; + s.Find(hql); + + s.Close(); + } |