I would like to execute the following two statements at once with NHibernate HQL:
update CustomFieldValue set Value = :newVal where Key = 1 and Value = :oldVal;
update CustomFieldValue set Value = :newVal where Key = 1 and Value = :oldVal;
I have created one string and try to update it with
var query = this.Session.CreateQuery(hql);
// ... set parameters
query.ExecuteUpdate();
But I always get a QuerySyntaxException. Isn't this possible with NHibernate 3.3.1 or am I doing something wrong?
I'm struggling to understand why you would want to do this? Am I missing it, or are the commands you want to submit to the database identical?
I'm totally guessing here, but are you really trying to do something like:
It seems to me, that would work?