如何使用 NHibernate 处理动态表?

发布于 2024-10-07 21:53:42 字数 163 浏览 0 评论 0原文

我会尽力解释我的情况;我的数据库中有大约 30 个表,其中 30 个表(例如 x)是部分动态的,当我说部分时,我的意思是可以向该表“x”添加更多列,但不能删除。一旦用户选择更多列,他应该能够从前端本身完成此操作,而无需开发人员参与。我已经在NHibernate中设计了我的DAL,现在的问题是如何实现动态DAL?

I will try to explain my situation; I have around 30 tables in my database out of these 30 one table (say x) is partially dynamic, when I say partially I mean that more columns can be added this table “x” but cannot be deleted. Once the user chooses to and more columns he should be able to do this from the frontend itself without getting the developer involved. I have designed my DAL in NHibernate, now the question is how do I achieve dynamic DAL?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百善笑为先 2024-10-14 21:53:42

您可以使用动态组件将这些属性映射到字典。

请记住,当您向映射添加列时,您必须重建 SessionFactory,但这不应该是一个大问题,因为它可能不会经常发生。

You can use Dynamic components to get those properties mapped to a dictionary.

Remember you'll have to rebuild your SessionFactory when you add a column to the mapping, but that shouldn't be a big issue, as it won't probably happen very often.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文