---
title: "Hibernate formula用法"
author: "smallsilver"
date: "2012-07-30T12:33:40Z"
tags: []
categories: ["数据库"]
slug: "hibernate-formula"
draft: false
lastmod: "2012-07-30T12:36:19Z"
id: 1611980
url: "https://wangde.iteye.com/blog/1611980"
---

好久没有使用formula,今天做项目用到了，差点忘了，
下面是hibernate formula用法，留待以后用：
<property name="checkContent" type="string" formula="(select h.FAULT_CONTENT from Z_JCJX_OP_ENGINE6DETAIL h where h.JX_ID = jx_id)" ></property>
<property name="compContent" type="string" formula="(select (select m.method_name from J_JCGY_FAULT_METHOD m where m.method_id = h.f_method_id) from Z_JCJX_OP_ENGINE6DETAIL h where h.JX_ID = jx_id)" ></property>