---
title: "hibernate Expression详解"
author: "hbldw521"
date: "2008-11-19T10:30:10Z"
tags: ["Hibernate", "SQL"]
categories: ["企业架构"]
slug: "hibernate-expression"
draft: false
lastmod: "2008-11-19T10:35:19Z"
id: 269940
url: "https://liudewen.iteye.com/blog/269940"
---

**hibernate Expression详解**
Expression.gt：对应SQL条件中的"field > value "。如：Expression.gt("salary", new Integer(5000)) 
Expression.ge：对应SQL条件中的"field >= value"。 
Expression.lt：对应SQL条件中的"field < value"。 
Expression.le：对应SQL条件中的"field <= value"。 
Expression.between：对应SQL条件中的"between"。 
Expression.like：对应SQL条件中的"field like value"。 
Expression.in：对应SQL条件中的"field in …"。 
Expression.eqProperty：用于比较两个属性之间的值，对应SQL条件中的"field = field"。如：Expression.eqProperty("Employee.id", "Group.eid"); 
Expression.gtProperty：用于比较两个属性之间的值，对应SQL条件中的"field > field"。 
Expression.geProperty：用于比较两个属性之间的值，对应SQL条件中的"field >= field"。 
Expression.ltProperty：用于比较两个属性之间的值，对应SQL条件中的"field < field"。 
Expression.leProperty：用于比较两个属性之间的值，对应SQL条件中的"field <= field"。 
Expression.and：and关系组合。