文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>NHibernate 2.1.0 : Executable queries

NHibernate 2.1.0 : Executable queries

时间:2010-09-22  来源:.net's

Nhibernate 2.1.0 support for bulk actions using HQL.

Some HQL examples:

insert into Animal (description, bodyWeight, mother) select description, bodyWeight, mother from Human

insert into Pickup (id, Vin, Owner) select id, Vin, Owner from Car

insert into Animal (description, bodyWeight) select h.description, h.bodyWeight from Human h where h.mother.mother is not null

update Human h set h.description = 'updated' where exists (select f.id from h.friends f where f.name.last = 'Public' )

update versioned IntegerVersioned set name = :name

update Human set name.first = :correction where id = :id

update Animal a set a.mother = (from Animal where id = 1) where a.id = 2

update Animal set description = :newDesc where description = :desc

update Animal set bodyWeight = bodyWeight + :w1 + :w2

delete SimpleEntityWithAssociation e where size(e.AssociatedEntities ) = 0 and e.Name like '%'

delete Animal where mother is not null

delete from EntityWithCrazyCompositeKey e where e.Id.Id = 1 and e.Id.OtherId = 2

using (var s = OpenSession())using (var tx = s.BeginTransaction()){  s.CreateQuery("delete from SimpleClass").ExecuteUpdate();  tx.Commit();}
 
link:NH2.1: Executable HQL
相关阅读 更多 +
排行榜 更多 +
尤雅闪耀汉化版下载

尤雅闪耀汉化版下载

休闲益智 下载
波卡小伙伴汉化

波卡小伙伴汉化

休闲益智 下载
诡事怪谈

诡事怪谈

策略塔防 下载