从 NHibernate 映射生成数据库模式

2024-03-09

是否可以从 Nhibernate 映射 DLL 生成数据库模式?

我的要求是MySQL。 如果是这样,我该怎么做?有这方面的工具/脚本吗?开源/免费软件工具?
此外,我可以使用这些工具将数据集插入/更新到数据库吗?


你有没有尝试过使用NHibernate 的内置模式生成工具 http://nhibernate.info/doc/nh/en/index.html#toolsetguide?

var cfg = new NHibernate.Cfg.Configuration();
cfg.Configure();
cfg.AddAssembly(typeof(AnEntityInYourMappingLib).Assembly);
new NHibernate.Tool.hbm2ddl.SchemaExport(cfg).Execute(false, true, false, false);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

从 NHibernate 映射生成数据库模式 的相关文章

随机推荐