Hibernate 是否可以通过代码更改支持与新列相关的数据库对象的更改

发布于 2024-12-29 03:32:44 字数 183 浏览 3 评论 0原文

有人可以指导我是否可以使用 Hibernate 进行 CRUD 操作,但主要设计要求是确保表中新添加的列可动态用于更新或插入,而无需更改代码。这是用于图书馆管理功能

这是否可行,之前我使用普通 JDBC 制作了这样的应用程序,其中从系统表检索表信息。不确定是否可以使用 Hibernate 来完成。

欢迎任何建议或方法。

Can someone guide me if I can use Hibernate for CRUD operations but the main design requirement is to make sure that newly added columns to tables are dynamically available for Updates or insert with out making code changes. This is for a Library Management functionality

Is this feasible, previously I made such application using plain JDBC where table information was retrieved from system tables. Not sure if that can be done using Hibernate.

Any suggestions or approach is welcomed.

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

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

发布评论

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

评论(1

月野兔 2025-01-05 03:32:44

不可以。您的实体中需要有适当的字段。不过,您仍然可以使用原始 JDBC。

但由于无论如何您都会部署新代码,因此最好添加相应的字段。最好让您的实体与数据库完美对应。

No. You need to have the appropriate fields in your entities. You can still use raw JDBC for that though.

But since you will be deploying new code anyway, you'd better add the corresponding fields. It is always best to have your entities correspond perfectly to the database.

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