New .Net Tutorial “Introduction to NHibernate”

I’ve just written a new tutorial on NHibernate (an Open Source OR Mapper for .Net).

As ususal any feedback much appreciated. :)

11 Responses to “New .Net Tutorial “Introduction to NHibernate””

  1. mizan Says:

    good

  2. Anindya Roy Chowdhury Says:

    Dear Danny,
    You did a great job for the learners who are new to Nhibernate. Many many thanks for simplyflying the topics for the Novice.
    May be in future i will depend on you when i have to be introduced new technologies.
    I really pleased reading a nice topics. Keep going on. Wish you a very bright future.

  3. Avinash Joshi Says:

    Unknown entity class: ContactDomain.Contact
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: NHibernate.MappingException: Unknown entity class: ContactDomain.Contact

    Source Error:

    Line 41: // Tell NHibernate that this object should be saved
    Line 42: //session.Save(contact);
    Line 43: session.Save(contact);
    Line 44:
    Line 45: // commit all of the changes to the DB and close the ISession

  4. altins Says:

    Hi Danny,

    Nice to know you.
    Nowadays, I am working on one my freelance project (a clinic website) and another project of mine (ebook management system). Actually, I kinda confuse to decide whether I have to use NHibernate or iBatis for both of them. Last year, I used iBatis for my previous project. But, I refer some people said that NHibernate is better and faster than iBatis.

    All I know is that iBatis can use Spring for its Business Layer, and UIP as its presentation layer.

    I try to find out if NHibernate can do the same thing like iBatis. I mean, can I use Spring for Business Prosess Layer, and if I can use Spring, then How?

    And can I also combine UIP with NHibernate? And how do I manage to do this?

    Thanks for your tutorial. And I’ll be waiting for your response.
    :) Keep Writing!

  5. Lacuna Says:

    Very good tutorial although it is a bit annoying that when copy / pasting the code (from Firefox at least) the line number translate into # symbols which you have to go through and take out. :)

  6. DannyT Says:

    To copy click the line above the code samples that says ‘Plain Text’ This will convert the highlighted code to plain text without line numbers

  7. mickster Says:

    Very nicely done. Although I couldn’t open the solution using .NET 2005 as your example code was created with a newer version. But other than that your post stands head and shoulders above the pack. Good work. I look forward to more on NHibernate and perhaps how it integrates with Spring.NET.

    Cheers.

    Mike

  8. mkultra Says:

    Great tutorial. As a newbie to NHibernate and .NET your walkthrough was very helpful and way more straightforward than the other examples I’ve seen.

    Thanks again!! :)

  9. George Says:

    This is great.. .. But.. I am trying to connect with an sql server 2005 , so I would like to know if you have one of these great tutorials for that case..
    (:P)

  10. DannyT Says:

    George, this is the beauty of NH, simply change lines 13-16 of the web.config section in the tutorial to:
    <add
    key=”hibernate.dialect”
    value=”NHibernate.Dialect.MsSql2005Dialect”
    />
    and you’re done, it’s also more or less as simple to switch to mysql or oracle databases.

  11. Mark Struzinski Says:

    Danny,
    This was an awesome walk-through, and helped me get through the initial painful steps of learning NHibernate. Any plans on doing the other tutorials you mentioned at the beginning of the post to get into NHibernate in more detail? Again, thanks! This has been a great help!

Leave a Reply