views:

552

answers:

3

Is there a Class Map generator for Fluent NHibernate? I need something like db2hbm but I want it to generate Fluent Class Maps instead of xml mappings.

I am aware of AutoMapping for Fluent but that is not what I want. I want to be able to generate Class Map files from tables in database and push them to my src repository.

+1  A: 

This is the closest thing I've come across (T4 Templates example to generate Fluent NH mappings): http://www.pnpguidance.net/Post/SampleFluentNHibernateT4TemplatesCodeGenerationLINQToSQL.aspx

Jay
tnx, i will give it a try
kaptan
These templates are already out of date.
Greg Hurlman
+4  A: 

You can do this with Visual NHibernate. Check the Fluent Nhibernate option on the Options screen to create FNH mapping code.

Gareth
Do you know any free tool that does the same job?
kaptan
As of today, Visual NHibernate is crashy as hell on my not all that complicated DB.
Greg Hurlman
+4  A: 

You can do this with NHibernate Mapping Generator.

RaRa
I wish I could upvote this 100 times!! this is an AWESOME open source tool from thought works, So simple and nice to use!!!
cgreeno
Doesn't generate code that compiles.
Greg Hurlman