Fluent NHibernate Table Dump Utility

Summary So I’ve been posting a lot about NHibernate over the past few months (Fluent NHibernate to be exact). Mostly motivated by frustrations with Entity Framework. I have spent the past week working with NHibernate in a production environment as a proof of concept example. The first problem with NHibernate is the fact that you … Read moreFluent NHibernate Table Dump Utility

Fluent NHibernate: Simple Many-to-Many Vs. Normal Many-to-Many Mapping Timing

Summary In an earlier post I showed how to map a many-to-many relationship without using the HasManyToMany mapper. So I finally put together a simple test project (technically it’s two projects in one solution) to test the two methods side-by-side. To my surprise, it is very difficult to tell if one is faster than the … Read moreFluent NHibernate: Simple Many-to-Many Vs. Normal Many-to-Many Mapping Timing

Fluent NHibernate Composite Key Many-to-Many

Summary I’m on a roll today, so I decided to create a new connection table between my Class table and Student table in my previous blog posts. This table is identical to the StudentClass table, except I removed the primary key and used only two fields and made them into a composite key. If you’re … Read moreFluent NHibernate Composite Key Many-to-Many

Fluent NHibernate: Removing a Relationship Connection From a Many-to-Many

In my last blog post I forgot to show how to disconnect a student from a class but leave both the student and the class records intact. So I quickly ninja’d something together to demonstrate how simple it is to perform this vital function. Here’s my code: First, I queried for the student I wished … Read moreFluent NHibernate: Removing a Relationship Connection From a Many-to-Many

Fluent NHibernate HasManyToMany the Normal Way

Summary As I mentioned in my last blog post, there is a simple way to treat a many-to-many data relationship involving basic mapping and handling the connection using the LINQ query itself. Now I’m going to show how the many-to-many mapping occurs involving more mapping commands and one less table (the connecting table called StudentClass). … Read moreFluent NHibernate HasManyToMany the Normal Way

Fluent NHibernate Many-to-Many Without Using HasManyMany

SummaryIn my last Fluent NHibernate post I showed how to do a One-to-Many mapping using the HasMany mapping method and ILists.  Getting the mappings to work correctly was a bit painful, and the outcome was questionable.  So I thought I’d try my hand at mapping a many-to-many situation without using the HasManyToMany mapping method or … Read moreFluent NHibernate Many-to-Many Without Using HasManyMany

Fluent NHibernate HasMany Mapping

Summary This post will demonstrate how a one-to-many mapping can be done in Fluent NHibernate. As in previous articles, I’m going to use my facultydata database with two tables to demonstrate the HasMany and References mappings. The Database First, we’ll need to make sure that both tables have primary keys. Then add a foreign key … Read moreFluent NHibernate HasMany Mapping

Fluent NHibernate Unit Testing Using SQLite

Summary So I’ve been producing a lot of blog posts on NHibernate lately. I’m attempting to evaluate NHiberate against other ORMs like Entity Framework. This blog post will focus no basic unit testing of NHibernate. I’m using Fluent with my NHibernate, but much of this knowledge still applies to straight NHibernate. SQLite Before I started … Read moreFluent NHibernate Unit Testing Using SQLite