Which ORM supports sql like batch insert/update/delete:
var user=new UserInfoFields();
var update=user.Update().Set
(
user.Field1=1,
user.Field2="xxxx"
).Where(user.Name=="Jim" && user.Enable==true);
update.Excute();
The corresponding T-sql is:
UPDATE UserInfo
SET
Field1=1,
Field2="xxxx"
WHERE Name='Jim' and Enable=1
PHP ActiveRecord has something like this, but that’s PHP. Linq2SQL can be extended to perform simpler batch updates/deletes, but it’s not “stock” behavior. Here’s the link to an article on the topic: http://www.aneyfamily.com/terryandann/post/2008/04/Batch-Updates-and-Deletes-with-LINQ-to-SQL.aspx. I know for a fact that NHibernate has nothing like this built in, but again, you can extend the Linq provider, and NH also allows HQL and SQL queries as strings, including batch updates/deletes (only problem is they’re “magic strings” that are not compiler-checked).
This kind of behavior really goes against what an ORM is designed to do. ORMs exist not to provide compiler-checked queries for all possible SQL operations, but to provide “black-box” encapsulated logic for CRUD operations of single instances of objects, for instance, turning a request for an object into SQL that retrieves the necessary data and hydrates the object. Batch and bulk operations are not their forte by any means.