NHibernate is an open-source object relational mapper for the Microsoft .NET platform. It makes it easy to retrieve data from relational databases and store them in objects. In this course, you'll be introduced to NHibernate, find out how to set up a project to use NHibernate, and use NHibernate to create various types of mappings to retrieve data from a relational database.
Learning Objectives
Getting Started with NHibernate
- start the course
- describe NHibernate and where it fits into the software development stack
- set up an IDE, tools, and drivers for using NHibernate
- import a database and reference NHibernate in a project
- create a configuration file for connecting to a database
- configure NHibernate using an existing App.Config file
- configure NHibernate without XML
- configure NHibernate using the fluent interface
Creating Mappings for NHibernate
- create mapping to retrieve data from a table
- create mappings to a class that retrieves data from tables with a one-to-many relationship
- add an assembly containing mappings to the configuration
- use mapping attributes as an alternative to the XML-based table approach to class mapping
- configure mappings using the fluent interface
- create class mappings using NHibernate's interface
- map classes by convention
Querying Data with NHibernate
- retrieve data with SQL queries
- retrieve data with HQL queries
- retrieve data with structured queries
- retrieve data with QueryOver queries
- filter data with LINQ queries
- group, sort, and restrict the number of records returned by query operations
Managing Data using NHibernate
- save new data and update existing data
- save a hierarchy of data to the database
- delete records from a table
- update and delete more than one record at a time using HQL queries
- commit or roll back operations using transactions
Practice: Using Mapping by Code
- configure a database and create a playlist