NHibernate Tutorial: Database-First & Model-First Using Visual ORM Designer

NHibernate Tutorial: Database-First & Model-First Using Visual ORM Designer


Learn how to create and configure an NHibernate model with Entity Developer — Devart’s powerful visual ORM designer for .NET.

In this step-by-step tutorial, we’ll cover both Database-First and Model-First approaches, show how to update models, generate mappings and classes, and even produce SQL scripts directly from your model. Whether you’re using Visual Studio or working in VS Code, Entity Developer makes NHibernate development faster, easier, and more reliable.

📌 What you’ll see in this video:
0:00 – Introduction
0:30 – Create NHibernate Model (Database-First)
1:11 – Update the Model
1:39 – Model-First Approach
2:49 – Generate SQL Script from Model

👉 Try Entity Developer free for 30 days: https://www.devart.com/entitydeveloper/

🔔 Subscribe to our channel and get dozens of tutorials about Devart tools: @DevartSoftware

#orm #net #nhibernate #entityframework #entitydeveloper #visualstudio #dotnet #devart
Closed Caption:

[Music]
In this video, we'll show you how to
create and configure an NHibernate model
using Entity Developer, a visual OM tool
from Devart that streamlines model
creation and code generation. Let's dive
in. Entity Developer works both as a
Visual Studio plug-in and as a
standalone application. Great if you're
working in an IDE like VS Code. In this
tutorial, we'll use Entity Developer as
a standalone tool and create a .NET
project in VS Code. No Visual Studio
required. Let's create an NHibernate
model using the database first approach.
Start by creating a new NHibernate model
and selecting database first. Choose
your data provider. You can use either
connect or an open-source connector. In
this demo, we're using a free data
connector to connect to a MySQL database
and enter the connection details.
Select the tables to import. Then use
the wizard to configure naming
conventions, model properties, and
default settings for mapping and code
generation.
Finally, save your model and generate
the mapping and entity classes. Your
nhibernate model is now ready.
To update your model, start by
right-clicking an entity and adding a
new property. Save your model and
regenerate the entity classes. This
updates the code to reflect your
changes. Then check the regenerated code
to confirm your property has been
applied correctly. Next, go to update
database from model to sync the model
changes with your database. Use the
wizard to review the schema updates and
execute the generated update script.
Now, let's build a model from scratch
using the model first approach. Create a
new nhibernate model and select model
first in the wizard. Set up model
preferences. Choose your code and
mapping templates. Then complete the
setup. Add your entities. Define
properties and set primary keys.
Use the diagram view to set up
relationships between entities using the
visual interface all without writing
code. These associations will be
reflected in the generated mappings and
classes automatically.
To model real world hierarchies, you can
define inheritance relationships between
entities. Add a base class and derive
other entities from it using the diagram
view or class editor. Entity developer
will generate the appropriate n
hibernate mappings for inheritance
strategies like table per hierarchy or
table per class. To generate a database
creation script, go to model, generate
database script from model. Follow the
wizard to configure the sync options and
select which entities to include.
Review your SQL script. It's ready to be
executed in your target database. Want
to simplify your nhibernate development?
Try Entity Developer Free for 30 days
and streamline your model design and
mapping. Download it now and elevate
your workflow.

Video Length: 03:19
Uploaded By: Devart
Published: 8/29/2025
View Count: 254

Related Software Products
Entity Developer
Entity Developer

Published By:
Devart

Description:
Entity Developer: Visual ORM Design for EF Core, Entity Framework and NHibernate Entity Developer is Devart's visual ORM designer for .NET developers. It turns a database into an Entity Framework Core, Entity Framework, NHibernate or LINQ to SQL model, lets you edit that model on a diagram, and generates the C# or Visual Basic code from templates you can change. The Professional edition behind this page's Buy Now button costs $319.95 for one...


Related Videos
.NET Data Community Standup: How dotConnect + Entity Developer simplify your workflow
.NET Data Community Standup: How dotConnect + Entity Developer simplify your workflow

Video Length: 56:00
Uploaded By: dotnet (3/20/2026)
View Count: 2,543

Entity Developer Overview: Visual ORM Designer for .NET
Entity Developer Overview: Visual ORM Designer for .NET

Video Length: 02:34
Uploaded By: Devart (6/19/2025)
View Count: 441

Build EF Core Models Visually with Entity Developer — No More Manual Mapping!
Build EF Core Models Visually with Entity Developer — No More Manual Mapping!

Video Length: 03:13
Uploaded By: Devart (7/24/2025)
View Count: 330

Copyright © 2026, Ivertech. All rights reserved.