Is there a Tool to Generate Fluent Auto Mapped Classes from an Existing Database?

Chris C's Avatar

Chris C

18 Feb, 2010 06:41 PM via web

Hello,

Excuse my ignorance as I'm new to both NHibernate and Fluent. I have a SQL 2008 database and would like to generate the entity classes from the data model. It would be nice if the classes where setup properly to support Fluent's auto mapping feature. Does such a tool already exist? Thank you.

  1. Support Staff 2 Posted by James Gregory on 18 Feb, 2010 07:19 PM

    James Gregory's Avatar

    Unfortunately there's no mechanism in Fluent NHibernate to do this, and I'm not aware of any in NHibernate itself either; the only utility I know of is one to generate classes from your mappings, but that won't be of much use in your situation.

    I know it's not what you want to hear, but it's often a good exercise to do it yourself anyway; especially when you're new to a tool, it can help you understand what's happening better. If you do decide to go this route, there's the wiki and the getting started guide that should help you begin, and you can always ask for assistance here.

  2. James Gregory closed this discussion on 19 Feb, 2010 12:06 PM.

  3. Chris C re-opened this discussion on 19 Feb, 2010 09:28 PM

  4. 3 Posted by Chris C on 19 Feb, 2010 09:28 PM

    Chris C's Avatar

    Hello James,

    Thank you for your response. I ended using MyGeneration
    (http://www.mygenerationsoftware.com/portal/default.aspx) and
    modifying an existing NHibernate script to get my entities written out
    in C#.

  5. Support Staff 4 Posted by James Gregory on 19 Feb, 2010 10:08 PM

    James Gregory's Avatar

    Great! Glad you managed to get something working.

  6. James Gregory closed this discussion on 19 Feb, 2010 10:08 PM.

Comments are currently closed for this discussion. You can start a new one.