NHibernate - 从数据库生成域 [英] NHibernate - Generate Domain from Database

查看:171
本文介绍了NHibernate - 从数据库生成域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以从域模型生成数据库表。但是有什么办法可以做其他的事情吗?我有一个非常糟糕的数据库(最糟糕的我见过)。它的分片(16个碎片!!)分割成多个postgres数据库(全部在同一个服务器上)与外键关系如urn:dbtable:guid。



它证明了使用SSIS迁移的屁股的主要痛苦,所以我想使用NHibernate,将数据读入对象,并在幸福的数据架构和谐中重写SQL Server数据库。



有没有办法使用NH或其他方式扫描当前数据库,并构建域模型和映射?



谢谢!

解决方案

NHibernate映射生成器

- 一个用于从现有DB表生成NHibernate映射文件和相应域类的简单实用程序



它是免费的。


I know its possible to generate the database tables from the domain model. But is there any way of doing things the other way. I have a totally awful database (worst I have ever seen). Its sharded (16 Shards!!), split across multiple postgres databases (all on the same server) with foreign key relations like urn:dbtable:guid.

Its proving a major pain in the ass to migrate using SSIS so I want to use NHibernate, read the data into objects and rewrite to a SQL Server database in blissful data-architectural harmony.

Is there any way to scan the current DB using NH or other and build a domain model and mappings?

Thanks!

解决方案

NHibernate Mapping Generator
- A simple utility to generate NHibernate mapping files and corresponding domain classes from existing DB tables

It's free.

这篇关于NHibernate - 从数据库生成域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆