NHibernate Designer

Entity Developer for NHibernate, being the best NHibernate designer to-date, allows you to create NHibernate models fast in a convenient GUI environment.

Devart has almost ten-year experience of developing visual ORM model designers for LINQ to SQL and Entity Framework and there is a number of satisfied LINQ to SQL and Entity Framework developers that use Entity Developer. Our extensive experience and skills have become the soundest cornerstone of our NHibernate designer.

Model-First, Database-First, or Mixed

With our NHibernate designer you can use either Model-First or Database-First design approach, or you may mix them in any way you like. Easy-to-use Update From Database and Update To Database wizards allow you to synchronize your model and database in any directions at any moment.

Update From Database Wizard tries to preserve manual changes to the model where possible. The Update From Database and Update To Database wizards detect all the database changes that can affect the model and vice versa, e.g. created and deleted tables and views, their columns and foreign keys, column datatype changes, etc.

All changes are displayed in an easy-to-understand form, and you can select only a part of the changes to apply. When updating database schema, Entity Developer considers database server specificity. It does not try to perform unsupported operations.

Update to Database Wizard

Tweak the Database-First Settings

When using database-first approach, Entity Developer for NHibernate provides a number of options for creating a model. You may tweak naming rules for the generated names of the classes and their members. Entity Developer allows you to configure case and pluralization, removing and adding of prefixes and suffixes, etc.

After this you may set the default parameters for the generated classes: default assembly and namespace, default schema, cascade style, strategy for accessing a property value, default identity generator and its parameters, etc.

Create Database-Independent Model

By default all the schema information is saved in the model mapping and this model can be used only with the database server of the database which the model was created from. If you need to use this model later with other database servers, you have to turn off preserving SQL type and default values. Other column parameters, such as length or scale and precision, will still be preserved, and Entity Developer can create a schema for any supported database server for this model.

If you don't need to store the schema information in your model, you may turn off preserving column details completely. Entity Developer still can create a schema for such model, based on naming rules, NHibernate types, and default settings, however this schema may differ from the one, the model was generated.

Importing Existing Models

Our NHibernate designer has wide capabilities of importing existing mapping for NHibernate model. It can import existing NHibernate mappings from various sources:

  • NHibernate mapping files
  • Visual Studio Project files
  • assembly files

If all or some particular types of the entity properties (simple, complex or navigation) are missing from the XML mapping file, they can be retrieved from other files (for example, .cs, .vb files, Visual Studio Project files or assembly files) that are imported alongside the XML mapping file. However, it is important to remember that such files are used only as the source of data for property types that are missing from the XML mapping file and that they are not imported into the model.

Importing models

Powerful NHibernate Designer

Easy to Start, Easy to Use

Designing NHibernate models with Entity Developer is easy and intuitive. Only the most frequently used mapping parameters are accessed through the editor dialog boxes, making our editors simple and easy to understand. If you need more extended mapping tuning, you can find all the available parameters of a model object in the Properties window.

All the mapping is defined visually, you don't need to manually edit XML mapping files.

NHibernate Designer Dialog Boxes

Rich Mapping Editors

Entity Developer for NHibernate supports almost all features of NHibernate mapping. It supports components, most kinds of associations, and all kinds of inheritance mapping strategies.

Advanced Drag-and-drop Support

To accelerate model design process, our NHibernate designer provides wide support for drag-and-drop functionality. After you have established a database connection, you may drag database tables and views from the Database Explorer window to your model diagram to create classes for these tables with already defined mapping.

To quickly create a TPC or TPH hierarchy in a model, reverse-engineered from a database, you may just drag several properties from the class to create a base or derived class from them. In the same way you may quickly create an NHibernate component from a set of class properties.

Keep Your Model Valid

Our NHibernate designer always validates your model while you are editing it. All errors and warnings automatically appear in the Error List window. Error list displays error or warning message and its location.

You can easily navigate to the object that caused an error by double-clicking it in the Error List window. Thus you may find and fix model errors quickly and conveniently.

Design-time validation

Generate Ready to Use NHibernate Configuration

NHibernate Entity Generation

With Entity Developer for NHibernate you may generate classes and mapping from the existing database in a few steps. Entity Developer generates POCO classes in C# or Visual Basic and supports third-party ADO.NET providers for SQL Server, Oracle, MySQL, PostgreSQL, DB2, and SQLite.

Our NHibernate designer comes with useful settings of NHibernate C# code generator:

  • Entities Output property allows you to specify output folder or output Visual Studio project for generated entities.

  • File Per Class option allows you to choose whether to generate classes either into a single code file or into a separate code file for each persistent class. This setting is used by default.

  • Generate Partial Classes property enables generation of partial classes with a separate file for generated code and a file for user code per class (Code-behind).

NHibernate Generator Capabilities

You can configure Entity Developer to generate classes with or without Equals and GetHashCode implementation, IValidatable interface implementation, and support for IPropertyChanging and IPropertyChanged events.

NHibernate Mapping Generation

Entity Developer NHibernate mapping generator can generate XML, Fluent NHibernate mapping (C#), and Loquacious (Mapping by code) C# mapping. Our NHibernate designer provides full support for Fluent NHibernate mapping - it supports all kinds of inheritances, components, composite IDs, etc.

NHibernate Configuration Generation

Entity Developer is also capable to generate NHibernate configuration XML code to the App.config file of the project or to a separate *.cfg.xml file. Configuration parameters are set in the Model Settings dialog box.

Seamless Visual Studio Integration

Entity Developer seamlessly integrates to Visual Studio. The model is created and edited just like any other Visual Studio project item. Code for a model is generated each time you save the model and is automatically placed to the project, containing the model, by default. You may redirect code output to other Visual Studio project.

Read More on code generation

Test Your Model at Design-Time

Our NHibernate designer allows viewing and editing data of tables, views, and model entities, create and execute LINQ and HQL queries against the model, eliminating the need for additional applications and reducing time for accessing these operations.

Executing HQL query against the model

Preparing Test Data

With Entity Developer you may perform viewing and quick editing of the database data from the tables in the Database Explorer. This data is editable, allowing you to quickly insert some data into the database to perform some testing.

Designing and Debugging LINQ and HQL Queries

Our NHibernate designer allows you to execute LINQ or HQL queries directly against the model without the need to write a sample application. You can use our built-in query editor to design queries, which can be saved for future use, and view the returned data and generated SQL.

Get Started with NHibernate Designer Quickly

Entity Developer comes with easy-to-start tutorials that quickly introduce you to the NHibernate model design process. These tutorials cover designing model from scratch, creating entities, associations, inheritances, defining mapping, generating code and database from the model, and reverse-engineering model from the database. There are two tutorials available:

We also provide NHibernate Mapping Samples application - a collection of 50 mapping samples with handy interface that demonstrate different cases of NHibernate mapping and have a working Visual Studio project and Entity Developer model for each case.