A fluent interface to NHibernate

Do you like NHibernate? Do you like XML? My answer would be yes for the former and no for the latter. But if you want to map your entities to the underlying database tables you have no other choice than use XML. Ok, you are right, we still have the possibility to use attributes for the mapping (e.g. by using Castle Active Record) but in this case we are "polluting" our nice domain objects with infrastructure related information which definitely does NOT belong into the domain model.

Here comes our salvation. We now have a third player in the field. As first published by Jeremy D. Miller and later on by others (James Gregory, Bobby Johnson, Zachariah Young, etc. ) we can map our domain objects by using a fluent interface which solves the following possible problems

  • Changing the property names of a domain model can break the NHibernate mapping
  • Changing the database fields can break the NHibernate mappings

and has the benefit of

  • we can write the mappings in plain old C#
  • the mapping is more expressive
  • the mapping is better testable

You can download the source code for the Fluent NHibernate project from here.

Sample

Let's make a quick sample. You can download it's source here.

In our domain model we have a Product class defined as follows

public class Product
{
    public virtual long Id { get; set; }
    public virtual string Name { get; set; }
    public virtual Decimal UnitPrice { get; set; }
    public virtual int UnitsOnStock { get; set; }
    public virtual bool Discontinued { get; set; }
}

This class we can now easily map to the underlying database with this code

public class ProductMap : ClassMap<Product>
{
    public ProductMap()
    {
        Id(x => x.Id);
        Map(x => x.Name);
        Map(x => x.UnitPrice);
        Map(x => x.UnitsOnStock);
        Map(x => x.Discontinued);
    }
 
}

Now let's write a quick test to see whether we can really e.g. add a new product to the underlying database. In our case the database used for tests is the SqlLite database.

Prerequisites

I have to write a helper class which will be my session source. The mapping framework already contains such a session source but its implementation does not fit my needs. Since it is not a complicate class I implement my own one. The session source class has to implement the interface ISessionSource also found in the mapping framework. Here is the code

public class MySessionSource : ISessionSource
{
    private readonly ISessionFactory _sessionFactory;
    private readonly Configuration _configuration;
 
    public MySessionSource(PersistenceModel model) : this(null, model)
    {
    }
 
    public MySessionSource(IDictionary<string, string> properties, PersistenceModel model)
    {
        if(model == null) throw new ArgumentException("Model cannot be null!");
 
        _configuration = new Configuration();
        if (properties == null)
            _configuration.Configure();
        else
            _configuration.AddProperties(properties);
 
        Model = model;
        model.Configure(_configuration);
 
        _sessionFactory = _configuration.BuildSessionFactory();
    }
 
    public PersistenceModel Model { get; private set; }
 
    public ISession CreateSession()
    {
        return _sessionFactory.OpenSession();
    }
 
    public void BuildSchema()
    {
        var session = CreateSession();
        BuildSchema(session);
    }
 
    public void BuildSchema(ISession session)
    {
        var connection = session.Connection;
 
        var drops = _configuration.GenerateDropSchemaScript(_sessionFactory.Dialect);
        executeScripts(drops, connection);
 
        var scripts = _configuration.GenerateSchemaCreationScript(_sessionFactory.Dialect);
        executeScripts(scripts, connection);
    }
 
    private static void executeScripts(string[] scripts, IDbConnection connection)
    {
        foreach (var script in scripts)
        {
            var command = connection.CreateCommand();
            command.CommandText = script;
            command.ExecuteNonQuery();
        }
    }
}

I have two overloaded constructors. I can either provide only the persistence model I use or pass the model and the necessary NHibernate configuration as dictionary of properties. In the former case the configuration is loaded from the usual hibernate.cfg.xml configuration file. The constructor then creates a new NHibernate configuration instance and uses the passed persistence model instance to feed the mapping information into the configuration instance.

The class also implements a method the create (or open) an new NHibernate session instance.

Finally we have a BuildSchema method which is overloaded. The second overload is needed when testing with SqlLite as database since when using this database in the in-memory mode (which we do in our unit tests) the database is destroyed whenever the session is closed. So, if I use a session instance to create the schema and then another for the test, then the latter does not have access to the database created by the former.

Base class for unit tests

I now write a base class for all unit test that I'll implement. This base class should be responsible for the (re-)creation of the database schema before each test runs. It should also open a new session object before each test which I can then use in my unit tests. Finally the base class should close an dispose the session after each test. Here is the code

public class FixtureBase
{
    private MySessionSource _source;
 
    protected ISession Session { get; private set; }
 
    [SetUp]
    public void SetupContext()
    {
        Before_each_test();
    }
 
    [TearDown]
    public void TearDownContext()
    {
        After_each_test();
    }
 
    protected virtual void Before_each_test()
    {
        _source = new MySessionSource(new TestModel());
        Session = _source.CreateSession();
        _source.BuildSchema(Session);
        CreateInitialData(Session);
        Session.Clear();
    }
 
    protected virtual void After_each_test()
    {
        Session.Close();
        Session.Dispose();
    }
 
    protected virtual void CreateInitialData(ISession session)
    {
    }
}

Note that the SetUp and TearDown methods just delegate to protected virtual methods Before_each_test and After_each_test respectively. The latter two methods can be overridden in any child class. In the Before_each_test method I use the session source class to a) create a new session instance and b) (re-)build the database schema. A call to the virtual method CreateInitialData is executed and then the session is cleared. The CreateInitialData method can be used in the child classes to setup the respective context for the unit tests.

The After_each_test method just closes and disposes the session.

The first unit test

Finally we can write our first test and verify whether the mapping with the fluent interface really works. First we want to try to add a new Product to the database. With all the prerequisites in place this is now easy. See the code below

[TestFixture]
public class Product_Fixture : FixtureBase
{
    [Test]
    public void Can_add_product_to_database()
    {
        var product = new Product
                          {
                              Name = "Apple",
                              UnitPrice = 0.25m,
                              UnitsOnStock = 1255,
                              Discontinued = false
                          };
        Session.Save(product);
 
        // Assertion
        Session.Flush();
        Session.Clear();
        var fromDb = Session.Get<Product>(product.Id);
        Assert.AreNotSame(product, fromDb);
        Assert.AreEqual(product.Name, fromDb.Name);
        Assert.AreEqual(product.UnitPrice, fromDb.UnitPrice);
        Assert.AreEqual(product.UnitsOnStock, fromDb.UnitsOnStock);
        Assert.AreEqual(product.Discontinued, fromDb.Discontinued);
    }
}
We define a new test class which inherits from our base class FixtureBase. The we define the test which creates a new instance of type Product and populates the various properties with sample data. We then call the Save method of the session and pass the product as a parameter.

Then we flush and clear the session and reload the Product from database. We assert that it has really been loaded from the database and not just taken out of NHibernate's first level cache (to avoid that we have flushed and cleared the session). Then we assert that the values of the properties all match.

Unit test revisited

If we have a lot of entities then we potentially have lot's of repetitive code to implement just to unit test all of our entities as above. Hey but wait a minute. There is a "better" way provided by the mapping framework. We can use the PersistenceSpecification class to eliminate the repetitive work. Let's look how our code will be

[Test]
public void Can_add_product_to_database_revisited()
{
    new PersistenceSpecification<Product>(SessionSource)
        .CheckProperty(x=>x.Name, "Apple")
        .CheckProperty(x=>x.UnitPrice, 0.25m)
        .CheckProperty(x=>x.UnitsOnStock, 2345)
        .CheckProperty(x=>x.Discontinued, true);
}

That's a nice reduction in lines of code. No "noise" any more, just the essential is left.

Note: Unfortunately this second approach has a side effect which in my opinion is not nice! The entity must inherit from the base class Entity provided by the mapping framework. This introduces a dependency in the domain model (the domain model must reference the mapping framework) and also is against the principle of POCO (plain old C# object). Maybe I want to provide a different entity base class. Well there is some room for improvement left...

Summary

If you want a clean domain model free from pollution by mapping attributes you had to define the mapping between entities and the underlying database with XML documents. XML is not very wrist friendly and also not very readable. Now there is a third alternative to define the mapping of entities to database - the fluent NHibernate API. One can now define the mapping in C# with a nice and very readable code.

As always you can download the code for the sample here.

Enjoy

Blog Signature Gabriel .

Print | posted on Monday, August 11, 2008 10:26 AM

Comments on this post

# re: A fluent interface to NHibernate

Requesting Gravatar...
<p>I like it :)</p>

<p>I started looking at the source code and as impressed (blog post)</p>

<p>As you know, I'm looking forward to the auto mappings feature when you get it ready (where they're inferred by convention rather than written by hand).</p>

<p>Will also be great to see an example application that uses your library. Perhaps that's a few iterations away, but at least your test cases are plentiful for those that want to see it in action :-)</p>
Left by Tobin Harris on Aug 12, 2008 12:16 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Does this library support forigen keys? I mean sub tables?
Left by Charlie on Aug 13, 2008 4:38 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
@Charlie: yes, and keep an eye on my following posts where I analyze common mapping scenarios
Left by Gabriel Schenker on Aug 13, 2008 8:57 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Verry slick. The convention over configuration I think will be the best approach. Grails uses it and it's really fun.

I've been searching lattely for different ORM's so I'll definitely be looking forward to your posts.

Thanks! You get a thumbs up from me :D
Left by Mihai on Aug 15, 2008 4:50 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I don't like to do the NHibernate mappings either. Here is a tool I found that can generate NHibernate mappings.

http://www.kellermansoftware.com/p-30-nunit-test-generator.aspx


Left by Greg Finzer on Aug 22, 2008 3:04 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I need to create a tool who can generate NHibernate mappings.No one like to do the NHibernate mappings either.
I found a tool like that u check that by this URL : Click here to Get generate NHibernate mappings Tool
Left by Praveen Prakash on Sep 19, 2008 2:02 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Here is a tool which helps you to generate NHibernate mapping files as well as Entity classes.

http://www.mygenerationsoftware.com
Left by Muneer on Oct 23, 2008 1:48 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Your demo app make no use of you custom "mySessionSource" class.
Left by pmlarocque on Nov 16, 2008 12:23 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
@pmlarocque: the Fluent NHibernate codebase has been updated and now my own implementation is not needed any more.
That's what happens when we are "living on the trunk"... ;-)
Left by nhibernate on Nov 17, 2008 12:49 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Thanks... a LLLLOOOTTTTT....

I hate xml configs... I will read this later.. hopping I can do more elegant and easyfull relations...


thanks...
PS: If I found this very interessting I will put a link in my blog...
Left by Guilherme Morais on Dec 19, 2008 3:52 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Enjoyed the post. I see the CreateInitialData method in

protected virtual void Before_each_test()
{
SessionSource = new SessionSource(new TestModel());
Session = SessionSource.CreateSession();
SessionSource.BuildSchema(Session);
CreateInitialData(Session);
Session.Clear();
}


I assume this would be used to setup any initial data in the tables needed for testing?

Left by Chev on May 14, 2009 12:14 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Well you are getting there... but I find it funny how much work people go through with NHibernate when LLBLGen Pro does all of this stuff so much more easily.

Its not perfect either, and if your mapping are really really weird, then NHibernate might fit better, but for 95% of the cases and for 100% for the new development cases LLBLGen will make this whole job of having a decent model and being able to persist it to a database so much easier.

I would probably never bother to write unit test for basic data in/out with LLBLGen, because I can trust that it just will work, I'll write unit test for business logic stuff, not nuts and bolts that the framework is supposed to do for me. I know, not POCO... but I'll be you are building your own framework behind the scenes too... and that is alot of work to get right.
Left by ozziiiiee on May 15, 2009 3:53 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
The convention over configuration I think will be the best approach. Grails uses it and it's really fun. I've been searching lattely for different ORM's so I'll definitely be looking forward to your posts.
Left by club penguin on Jun 02, 2009 7:33 PM

# This is really some awesome advice. Keep it up, my colleagues would love this.

Requesting Gravatar...
This is really some awesome advice. Keep it up, my colleagues would love this.
Left by Earn Money Online on Jul 28, 2009 2:14 PM

# Make Money Online

Requesting Gravatar...
Its not perfect either, and if your mapping are really really weird
Left by Make Money Online on Sep 05, 2009 9:18 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Hello , i did not understand how can i download the source. I am getting not a zip file of some sort , but the published files on some host. Is there some method to download all the files together ?
Left by Gregory on Sep 06, 2009 7:01 PM

# Good stuff

Requesting Gravatar...
Great stuff! Good post with solid info! Thanks
Left by how to quit smoking on Sep 11, 2009 4:54 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Did you try right-clicking to download?

Great article, by the way. I'm very new at this but muddling my way through it.
Left by Quick Weight Loss on Oct 03, 2009 4:10 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
This is a great article. I was struggling with that code, so thank you for posting it up!
Left by Respectable Reviews on Oct 05, 2009 2:31 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I tried this code but doesnt seem to work for me.
Left by electric wheelchairs on Oct 09, 2009 9:57 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
"The convention over configuration I think will be the best approach. Grails uses it and it's really fun. I've been searching lattely for different ORM's so I'll definitely be looking forward to your posts." Grails does use it, but I don't believe that the configuration is the best representation.
Left by river cruises in europe on Oct 10, 2009 8:53 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Thanks for providing such a great post. I have bookmarked it for my husband.
Left by los angeles web design on Oct 12, 2009 1:26 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Can't start it...hmm.
Left by Free Vacation on Oct 17, 2009 10:35 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Gabriel, this is an awesome resource! I've been interested in this domain for quite a while but there are a real lack of such information. I've already bookmarked your site. Please keep up the good work yeah?
Left by Ed on Oct 19, 2009 2:22 PM

# Great

Requesting Gravatar...
The code here is pretty awesome. The post is awesome, thanks for sharing!
Left by Work At Home on Oct 21, 2009 11:30 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I first encountered Hibernate in Java nearly a decade ago. It sure beat EJBs then, although some early versions had weird bugs. But it's great that we can even find it available for dotNet. I wonder if it will be ported to other languages like php and ruby? That would be great.
Left by offshore drilling companies on Oct 22, 2009 12:46 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Now that's some really inspired coding work. Very interesting to see it, thanks for posting
Left by weight loss tips for women on Nov 01, 2009 8:29 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Your demo app make no use of you custom "mySessionSource" class.
Left by auto insurance quotes on Nov 02, 2009 5:29 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Thanks for sharing.
Left by cleaner reviews on Nov 15, 2009 2:27 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
* Changing the property names of a domain model can break the NHibernate mapping
* Changing the database fields can break the NHibernate mappings

and has the benefit of

* we can write the mappings in plain old C#
* the mapping is more expressive
* the mapping is better testable
Left by Orkut Greetings on Nov 16, 2009 10:54 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
You have really saved me a lot of hassle because now I understand things way better than before.
Left by Silke on Nov 25, 2009 6:47 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I have tried this but do not seem to work.
Left by work at home blog on Nov 26, 2009 9:18 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I was referred here by my friend, but it seems it does not work properly. Can you please check it?
Left by hypnosis on Dec 03, 2009 2:25 AM

# Awesome

Requesting Gravatar...
Blogging is now becoming one of the new phenomenal ways to make money online. It is no surprise because you can work on your own hours, if you call it working that is.
Left by Make Money Online on Dec 07, 2009 7:15 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
My answer is also yes for the former and no for the latter. Thanks for the really great post. It will be really helpful for the databases on my home based business websites.
Left by Work from Home on Dec 09, 2009 7:36 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I tried it and it worked. Thank you!
Left by Kimbo Slice on Dec 09, 2009 7:38 PM

# Very cool

Requesting Gravatar...
Very good code work. Quite interesting but a little above my techie abilities.
Left by Dog Training on Dec 09, 2009 7:40 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I want to express my admiration of your writing skill and ability to make reader to read the while thing to the end. I would like to read more of your blogs and to share my thoughts with you. I will be your frequent visitor, that’s for sure.
Left by audio chat video on Dec 10, 2009 8:42 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Creating an effective user interface design is a hard churned out job by a set of highly dedicated designers and software engineers.
Left by SEO on Dec 10, 2009 10:02 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
XML Server can be a Web Server that stores the XML files in it and serves them on demand. The XML Server would have processing capabilities with an XML engine and to transform the XML document to other forms. Basically a server which hosts and serves the XML documents is called a XML Server.
Left by utah photography on Dec 11, 2009 5:22 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
If you have a lot mabinogi gold,you can have better equipment in the game
Left by buy mabinogi gold on Dec 14, 2009 9:03 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
thanks for sharing.. it worked..
Left by for home water purifier on Dec 16, 2009 11:24 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Great article. It's been very helpful. I'm also taking a dive into NHibernate too.
I'll appreciate it if u can send me the source code; or you can place a download link together with the article.
Left by slots on Dec 18, 2009 12:26 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Welli m not an expert coder just a beginner but iwill try this out for sure.
Left by brochure design on Dec 18, 2009 10:07 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I mean sub tables?
Left by pandora jewelry on Dec 24, 2009 11:58 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Great article. It's been very helpful. I'm also taking a dive into NHibernate too.
Left by how to get a six pack in 2 weeks on Dec 27, 2009 8:18 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Welli m not an expert coder just a beginner but iwill try this out for sure.
Left by how to get a six pack quickly on Dec 27, 2009 8:19 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I mean sub tables?
Left by how to get a six pack fast on Dec 27, 2009 8:19 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
this out for sure.
Left by canadian online on Dec 28, 2009 7:29 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Your fantastic knowledge connecting with this topic sould be a basis for thesis writing service or for some dissertation writing service and be utilized at publish dissertation.
Left by Fa28Sarah on Dec 31, 2009 5:06 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I like it.
Left by DFO Gold on Jan 02, 2010 7:13 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Very good example. Thank you! Vera @ Canadian Mortgages
Left by Your Loan on Jan 05, 2010 3:08 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It's always nice when you can not only be informed, but also entertained!
Left by drug treatment center on Jan 07, 2010 5:16 AM

# 12sky2 Gold

Requesting Gravatar...
12sky2 Gold plays an important role in the game, we all know that twelve sky2 Gold and twelvesky2 Gold can make all the game players happy.
Left by 12sky2 Gold on Jan 08, 2010 1:54 PM

# Cheap Dofus Kamas

Left by Cheap Dofus Kamas on Jan 08, 2010 2:07 PM

# Asda Story gold

Requesting Gravatar...
Have you heared about a game which you need use Asda Story gold to play, and you can also borrow AsdaStory gold from other players. But you can buy Asda gold. If you buy Asda Story gold, you can continue this game.
Left by Asda Story gold on Jan 08, 2010 3:22 PM

# warcraft gold

Requesting Gravatar...
You should know wow gold, or World of Warcraft Gold if you play this game. I can say so: each gamer want to buy wow gold to promote their character level easily, more warcraft gold and wow money they own, more items they can buy in game. While we provide you cheap wow gold, surely you can get them at cheap prices.
Left by warcraft gold on Jan 08, 2010 9:01 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Another great posting. Keep up the great work in 2010! All the best.
Left by David on Jan 11, 2010 7:29 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Hi,
I found your website perfect for my needs. It contains wonderful and helpful posts. Thanks for sharing with us. Keep up the good work!
Left by Custom Essay on Jan 12, 2010 6:33 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
yes that is right t
Left by make money online on Jan 16, 2010 1:19 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles|, I guess I am not the only one having all the enjoyment here! keep up the good work.
Left by gicci on Jan 16, 2010 9:07 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Hi,
This is really a nice post, you share good piece of information.
Left by Dissertation Help on Jan 17, 2010 8:04 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Hi,
It was a very nice article! Just want to say thank you for the information you have shared. Just continue writing this kind of post. Thanks.

http://www.ukacademia.co.uk
Left by Assignment Help on Jan 18, 2010 6:30 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Hi,
You made some good points there. I did a search on the topic and found most people will agree with your blog. Thanks
Left by Oliver Kent on Jan 18, 2010 7:25 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Hi,
Nice post! You have worked hard on jotting down the essential information. Keep sharing the good work in future too.

www.customcoursework.co.uk
Left by A level coursework on Jan 18, 2010 7:29 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Thanks for this post mate! I will definitely visit your blog more often for this type of info. Regards!
Left by Small business financing on Jan 20, 2010 6:01 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I need some more samples regarding my assignment that I have to submit as soon as possible.
Left by stanley tang review on Jan 20, 2010 10:50 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
very good
Left by Cheap Dofus Kamas on Jan 21, 2010 4:47 PM

# cheap domo gold

Requesting Gravatar...
You should know domo gold, or Dream of Mirror Online gold if you play this game. I can say so: each gamer want to buy domo gold to promote their character level easily, more Dream of Mirror gold they own, more items they can buy in game. While we provide you cheap domo gold, surely you can get them at cheap prices.
Left by cheap domo gold on Jan 22, 2010 6:28 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Hi,
This is really great work. Thank you for sharing such a useful piece of information here in the blog.
Left by Buy Term Papers on Jan 25, 2010 5:30 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Your demo app make no use of you custom "mySessionSource" class.

auto insurance comparison

whole life insurance
Left by Jenny on Jan 25, 2010 7:01 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
I like the post. Detail web information.
Left by Make money onlin on Jan 26, 2010 8:46 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Great code! Good work!
Left by herbal remedies on Jan 26, 2010 1:41 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
again, great stuff!
Left by how to stop snoring on Jan 26, 2010 4:25 PM

# Asda Story gold

Requesting Gravatar...
Asda Story
http://www.asdagold.com
Asda Story gold, AsdaStory gold, Asda gold, buy Asda Story gold
Do you know Asda Story gold?if you play online game,you will knowAsdaStory
Left by add on Jan 26, 2010 7:55 PM

# Do you know[url=http://www.buyrohan.com]Rohan Gold[/url]?

Requesting Gravatar...
Do you know[url=http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com]Rohan Gold[/url]?if you play the online game,you will know[url=http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com]Rohan Crone[/url]is the game gold. In the game,if you had more[url=http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com]Rohan Crones[/url],you will had a tall level. But you want to[url=http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com]Rohan online Gold[/url],you can come here and spend a little money to bought[url=http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com">http://www.buyrohan.com" title="http://www.buyrohan.com">http://www.buyrohan.com]Rohan online Crone[/url].Quockly come here
Left by Rohan Gold on Jan 27, 2010 5:20 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Fluent mapping is the namesake mapping style that Fluent NHibernate uses. It's a fluent interface that allows you to map your entities completely in code.
Left by betting system on Jan 27, 2010 10:15 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
What's more, a bracelet can also be equipped with different small http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/ and even you can change it according to your mood at any time. Here are some meanings of pendant. Small Plane stands for traveling and adventure ; anchor, stability and hope; your baby's boots, having a lot of babies; small feeding http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/Bracelets/ abundant food; Church means happiness and stability of marriage; dragonfly means riches; Eiffel Tower means travel and exploration; four-leaf clover means fortune; horseshoe means luck; Nest means a happy family; bride shows a happy bride in her coming http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/ ship steering shows calming and confidence; http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/ coin http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/ shows rich marriage life. Wish bone, dreams being about to come true; http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/">http://www.pandora4sale.com/" title="http://www.pandora4sale.com/">http://www.pandora4sale.com/Bracelets/ , love; one heart shot by an arrow, romantic love; purse, wealth; and heart-shaped lock, true love.
Left by pandora jewelry on Jan 28, 2010 2:46 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Hi. Thanks for the code it was very usefull for me! Julian from make money online
Left by How to make money online? on Jan 30, 2010 6:02 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
nice ones
Left by blu ray ripper on Jan 31, 2010 1:33 PM

# wala lang

Left by website consultant Adelaide on Jan 31, 2010 8:52 PM

# re: A fluent interface to NHibernate

Left by make money on Feb 01, 2010 11:22 AM

# re: A fluent interface to NHibernate

Left by regtweaker on Feb 01, 2010 7:48 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
Maybe you are obsessed with
diverse links of london, but
have you ever considered that the links of london charms in the store
casement are better for ladies with large links of
london necklaces
will be
gentle, allay, and links of
london bracelets
?
Left by links of london on Feb 02, 2010 7:56 PM

# Ever Quset2 plat

Requesting Gravatar...
how to can earn much eq2 Platinum on the internet Ever Quset2 Platinum.
Left by Ever Quset2 plat on Feb 04, 2010 5:16 PM

# re: A fluent interface to NHibernate

Requesting Gravatar...
dude.. u sure have a lot of typos in your title :/
Left by Blu Ray Ripper on Feb 06, 2010 3:43 AM

# re: A fluent interface to NHibernate

Requesting Gravatar...
The Convention on the settings that I think will be the best approach. Grails uses and is really fun. I've been looking for ORM lattely different from what is definitely going to be attentive to your messages.
Left by Free Xbox Live on Feb 06, 2010 11:39 AM

# Cool

Requesting Gravatar...
You make some really good points here!
Left by love poems & quotes on Feb 08, 2010 1:07 PM

Your comment:

 (will show your gravatar)
 
Please add 2 and 7 and type the answer here: