What is NHibernate?

前端 未结 5 1134
予麋鹿
予麋鹿 2020-12-07 20:06

As a followup to my previous question. I am an ASP.NET Programmer, and am wondering how NHibernate would help me get my job done easier and more quickly than it would other

5条回答
  •  盖世英雄少女心
    2020-12-07 21:03

    NHibernate is a ORM (Object-Relational Mapper) tool. It creates an object oriented model based on your database schema.

    From https://www.hibernate.org/343.html

    NHibernate key features:

    • Natural programming model - NHibernate supports natural OO idiom; inheritance, polymorphism, composition and the .NET collections framework, including generic collections.

    • Native .NET - NHibernate API uses .NET conventions and idioms

    • Support for fine-grained object models - a rich variety of mappings for collections and dependent objects

    • No build-time bytecode enhancement - there's no extra code generation or bytecode processing steps in your build procedure

    • The query options - NHibernate addresses both sides of the problem; not only how to get objects into the database, but also how to get them out again

    • Custom SQL - specify the exact SQL that NHibernate should use to persist your objects. Stored procedures are supported on Microsoft SQL Server.

    • Support for "conversations" - NHibernate supports long-lived persistence contexts, detach/reattach of objects, and takes care of optimistic locking automatically

    • Free/open source - NHibernate is licensed under the LGPL (Lesser GNU Public License)

提交回复
热议问题