使用 Hibernate 将列作为列总和或差值
我有一个 hibernate pojo 类,它有一些字段。假设有三个字段。一个是其他的总和。我的意思是有第 1 列、第 2 列、第 3 列。
我如何使用 Hibernate 作为注释来定义第 3 列 =column1+column2 。 我想我们可以用标准 SQL 来定义它,比如
create table x(columnt1 ......,column2......,column3 as column1+column2)
我不确定,有没有办法做到这一点冬眠?
I have a hibernate pojo class and it has some field. Assume that there are three field. One is sum of the others. I means there are column 1, column 2 , column 3.
How can i define column 3 =column1+column2 with Hibernate as annotation.
I guess we can define it with standart SQL like
create table x( columnt1 ......, column2 ......, column3 as column1+column2)
i'm not sure , is there a way to do that with hibernate ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
省略该列并使用属性
leave out the column and use properties