From: <fab...@us...> - 2009-05-06 14:22:17
|
Revision: 4250 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4250&view=rev Author: fabiomaulo Date: 2009-05-06 14:22:12 +0000 (Wed, 06 May 2009) Log Message: ----------- Continue port of AST tests for Updates (ManyToOne entity) Modified Paths: -------------- trunk/nhibernate/src/NHibernate.Test/HQL/Ast/BulkManipulation.cs Modified: trunk/nhibernate/src/NHibernate.Test/HQL/Ast/BulkManipulation.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/HQL/Ast/BulkManipulation.cs 2009-05-06 06:12:21 UTC (rev 4249) +++ trunk/nhibernate/src/NHibernate.Test/HQL/Ast/BulkManipulation.cs 2009-05-06 14:22:12 UTC (rev 4250) @@ -2,6 +2,7 @@ using System.Collections; using System.Diagnostics; using System.Threading; +using NHibernate.Dialect; using NUnit.Framework; using NHibernate.Hql.Ast.ANTLR; @@ -200,6 +201,23 @@ s.Close(); } + [Test] + public void UpdateOnManyToOne() + { + ISession s = OpenSession(); + ITransaction t = s.BeginTransaction(); + + s.CreateQuery("update Animal a set a.mother = null where a.id = 2").ExecuteUpdate(); + if (! (Dialect is MySQLDialect) ) + { + // MySQL does not support (even un-correlated) subqueries against the update-mutating table + s.CreateQuery("update Animal a set a.mother = (from Animal where id = 1) where a.id = 2").ExecuteUpdate(); + } + + t.Commit(); + s.Close(); + } + #endregion #region DELETES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |