1

Does the last NHibernate version support record updates via HQL ?! What about this statement?

 UPDATE Table_1 SET Value=Value+@Increment, @Result=1
        WHERE Id=@Id AND Value+@Increment<=@MaxLimit;SELECT @Result

Is it possible to execute above statement and get @Result via plane sql (CreateSqlQuery) at least ?

Mark Carmark
  • 167
  • 4
  • 11

1 Answers1

1

Yes, you can do batch updates and deletes via HQL.

See @Mpritch's answer to the following question for an example: Batch Update in NHibernate

And as you mentioned, you could always use sql or a stored proc to do the update.

I believe RowCount is what you are looking for in terms of @Result data

Community
  • 1
  • 1
Tim Hoolihan
  • 12,316
  • 3
  • 41
  • 54