NHibernate Generators

What is the best tool for generating Entity Class and/or hbm files and/or sql script for NHibernate.

This list below is from http://www.hibernate.org/365.html, which is the best any why?

  • Moregen Free, Open Source (GPL) O/R Generator that can merge into existing Visual Studio Projects. Also merges changes to generated classes.
  • NConstruct Lite Free tool for generating NHibernate O/R mapping source code. Different databases support (Microsoft SQL Server, Oracle, Access).
  • GENNIT NHibernate Code Generator Free/Commercial Web 2.0 code generation of NHibernate code using WYSIWYG online UML designer.
  • GenWise Studio with NHibernate Template Commercial product; Imports your existing database and generates all XML and Classes, including factories. It can also generate a asp.net web-application for your NHibernate BO-Layer automatically.
  • HQL Analyzer and hbm.xml GUI Editor
  • ObjectMapper by Mats Helander is a mapping GUI with NHibernate support
  • MyGeneration is a template-based code generator GUI. Its template library includes templates for generating mapping files and classes from a database.
  • AndroMDA is an open-source code generation framework that uses Model Driven Architecture (MDA) to transform UML models into deployable components. It supports generation of data access layers that use NHibernate as their persistence framework.
  • CodeSmith Template for NH
  • NHibernate Helper Kit is a VS2005 add-in to generate classes and mapping files.
  • NConstruct - Intelligent Software Factory Commercial product; Full .NET C# source code generation for all tiers of the information system trough simple wizard procedure. O/R mapping based on NHibernate. For both WinForms and ASP.NET 2.0.

  • I think you should look at Fluent NHibernate instead. Generating mappings always gets you to the 80% mark, and you still have to customize to get what you want. Fluent-NHibernate allows you to map your entities with a compile-safe and refactor-friendly API.


    There a new 2.0 Beta 2 release available with lots of new features and support for fluent nhibernate, one-to-many and many-to-many mapping.

    http://www.codeplex.com/Wikipage?ProjectName=nmg


    您可以尝试将Mindscape NHibernate Designer安装到Visual Studio 2010中。虽然我还没有尝试过。

    链接地址: http://www.djcxy.com/p/60264.html

    上一篇: 实体框架4,定义关系

    下一篇: NHibernate生成器