根据对象定义生成数据库表 [英] Generating database tables from object definitions

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

问题描述

我知道有几种(自动)方法可以创建数据访问层来处理现有数据库(LINQ to SQL,Hibernate等).但是我有点累了(我相信应该有一种更好的做事方式),例如:

I know that there are a few (automatic) ways to create a data access layer to manipulate an existing database (LINQ to SQL, Hibernate, etc...). But I'm getting kind of tired (and I believe that there should be a better way of doing things) of stuff like:

  1. 在Visio中创建/更改表
  2. 使用Visio的更新数据库"创建/更改数据库
  3. 将表导入"LINQ to SQL类"对象
  4. 相应地更改代码
  5. 编译

从对象/实体定义生成数据库架构的方法怎么样?我似乎找不到像这样的工具的良好参考(我希望至少在某些框架中会有某种内置的支持).

What about a way to generate the database schema from the objects/entities definition? I can't seem to find good references for tools like this (and I would expect some kind of built-in support in at least some frameworks).

如果我能做到,那将是完美的:

It would be perfect if I could just:

  1. 更改对象定义
  2. 更改操纵对象的代码
  3. 编译(数据库更改自动完成)

推荐答案

查看 DataObjects.Net -是专为支持这种情况而设计.仅代码,没有别的.它的模式升级层可能是您所能找到的功能最强大的一个,它完全完全抽象了架构升级SQL.

Check out DataObjects.Net - is is designed to support exactly this case. Code only, and nothing else. Its schema upgrade layer is probably the most featured one you can find, and it really fully abstracts schema upgrade SQL.

查看产品视频-您会注意到没有做任何其他事情同步架构.架构升级样本显示了此功能的预期用途.

Check out product video - you'll notice nothing additional is made to sync the schema. Schema upgrade sample shows the intended usage of this feature.

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

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