代码改变世界

NHibeginner Ch8 writing Queries

2011-07-10 17:21  一一九九  阅读(144)  评论(0编辑  收藏  举报

Definitely one of the strongest reasons for switching to NHibernate has to be the way that you query data .

The basic data access object
     in order for out data access objects to be effective for our use, they need to contain a few basic methods. in general, our DAOs will be responsible for all of the CRUD Operations, so we will need to create methods to handle those operations.

Session.Refresh()

   forcing NHibernate to retrieve the latest object from the database directly instead of a potentially cached copy.this is useful if we have an outside process, service, or user that may be inteacting with the database behind the scenes.

这个DAS层就是将数据库和Domain Entity联系起来的一个Layer.