Hibernate中Formula的xml配置

来源:互联网 发布:家电销售数据 编辑:程序博客网 时间:2024/06/12 23:14

使用注解配置:http://blog.csdn.net/delongcpp/article/details/43194361

使用xml配置:http://blog.sina.com.cn/s/blog_86f4502c0101fhan.html

 

在xml中配置:

<property name="satisfaction" type="string"            formula="(select t.key from Param t where t.description='satis' and t.value=SATISFACTION)"            update="false"            insert="false"/>

这里的t.value=SATISFACTION中的SATISFACTION是当前配置文件中映射的表中的字段名。

原创粉丝点击