a.ras2002
a.ras2002

Reputation: 385

Can Nhibernate generate automatically mapping files from database?

I'm quite new with NHibernate and it's the first ORM that I use. The question is if there is possible to generate automatically all the mapping files from a database (MySQL) that I already have created

Thanks in advance!

Upvotes: 0

Views: 647

Answers (1)

Amit Joshi
Amit Joshi

Reputation: 16389

No, NHibernate does not provide this feature out of the box. But there are tools developed by others; you will find many if you search Google.

I use NHibernateMappingGenerator. https://github.com/rvrn22/nmg.

Tool is very flexible and allow you configuring how the mappings and entities should be generated. Multiple settings help you tune the output with your expectations.

In some cases you may still need to modify the entities and mapping files to fit your requirements. But still, this automates much work and lay down skeleton for further fine-tuning.

Upvotes: 1

Related Questions