开发者

What will be the benefits of NHibernate in a data retrieval only scenario?

开发者 https://www.devze.com 2022-12-19 04:15 出处:网络
We have been suggested to use NHibernate for our project. But the point is our application will only be retrieving the data from the database so are there any benefits of using NHibernate in this scen

We have been suggested to use NHibernate for our project. But the point is our application will only be retrieving the data from the database so are there any benefits of using NHibernate in this scenario?

One 开发者_StackOverflowmore thing, what is the query execution plan in NHIbernate does it support something like prepared statements or the so called pre complied statements.?


I agree to the answers above, but there is one more reason for using nhibernate: Your completely independend of the underlaying database system. You can switch from mysql to oracle and the only thing you have to do, is to change the settings. the access to the database stays exactly the same.


NHibernate is useful is you need to map data from a database table into a .NET class. Even if you're only doing select queries, it still might be useful if you need to pass the data objects to a client tier (web page, desktop app, etc.) for display. Working with plain objects can be easier than working with a DataSet or other ADO.NET data class in a presentation layer.

NHibernate does have the ability to parse/pre-compile queries if you put them in the mapping file.


The benefit for using NHibernate in a read only scenario is that you would not need to map the results of queries back to .net objects as the runtime would do this for you. Also, it provides a more object oriented query syntax (you can also use LINQ), and you can take advantage of lazy loading.

I don't believe NHibernate can use prepared statements unless you are having it call stored procedures.

0

精彩评论

暂无评论...
验证码 换一张
取 消