﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-为了生活而生活-文章分类-hibernate</title><link>http://www.blogjava.net/terry711/category/21101.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 08 Apr 2008 09:33:28 GMT</lastBuildDate><pubDate>Tue, 08 Apr 2008 09:33:28 GMT</pubDate><ttl>60</ttl><item><title>转 Spring提供的Hibernate申明式事务管理有两种办法 </title><link>http://www.blogjava.net/terry711/articles/190168.html</link><dc:creator>terryliu</dc:creator><author>terryliu</author><pubDate>Tue, 01 Apr 2008 09:49:00 GMT</pubDate><guid>http://www.blogjava.net/terry711/articles/190168.html</guid><wfw:comment>http://www.blogjava.net/terry711/comments/190168.html</wfw:comment><comments>http://www.blogjava.net/terry711/articles/190168.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/terry711/comments/commentRss/190168.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/terry711/services/trackbacks/190168.html</trackback:ping><description><![CDATA[<p>Spring提供的Hibernate申明式事务管理有两种办法 </p>
<p>a) 配合使用org.springframework.transaction.interceptor.TransactionInterceptor和org.springframework.orm.hibernate.HibernateTransactionManager，下面是spring reference的例子 <br />
</p>
<table cellspacing="1" cellpadding="3" width="90%" align="center" border="0">
    <tbody>
        <tr>
            <td><span class="genmed"><strong>代码:</strong></span></td>
        </tr>
        <tr>
            <td class="code">&lt;beans&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; ... <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;bean id="myTransactionManager" <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class="org.springframework.orm.hibernate.HibernateTransactionManager"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="sessionFactory"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ref bean="mySessionFactory"/&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;/bean&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;bean id="myTransactionInterceptor" <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class="org.springframework.transaction.interceptor.TransactionInterceptor"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="transactionManager"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ref bean="myTransactionManager"/&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="transactionAttributeSource"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; product.ProductService.increasePrice*=PROPAGATION_REQUIRED <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; product.ProductService.someOtherBusinessMethod=PROPAGATION_MANDATORY <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;/bean&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;bean id="myProductServiceTarget" class="product.ProductServiceImpl"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="productDao"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ref bean="myProductDao"/&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;/bean&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;bean id="myProductService" class="org.springframework.aop.framework.ProxyFactoryBean"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="proxyInterfaces"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value&gt;product.ProductService&lt;/value&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="target"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ref local="myProductServiceTarget&lt;"/&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="interceptorNames"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;list&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value&gt;myTransactionInterceptor&lt;/value&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/list&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;/bean&gt; <br />
            &nbsp; &nbsp; &lt;/beans&gt;</td>
        </tr>
    </tbody>
</table>
<span class="postbody"><br />
<br />
HibernateInterceptor和事务无关，它的用途在javadocs中描述如下： <br />
</span>
<table cellspacing="1" cellpadding="3" width="90%" align="center" border="0">
    <tbody>
        <tr>
            <td><span class="genmed"><strong>引用:</strong></span></td>
        </tr>
        <tr>
            <td class="quote">This interceptor binds a new Hibernate Session to the thread before a method <br />
            call, closing and removing it afterwards in case of any method outcome. <br />
            If there already was a pre-bound Session (e.g. from HibernateTransactionManager, <br />
            or from a surrounding Hibernate-intercepted method), the interceptor simply <br />
            takes part in it.</td>
        </tr>
    </tbody>
</table>
<span class="postbody"><br />
<br />
b)使用TransactionProxyFactoryBean，下面是Spring Reference中的例子 <br />
</span>
<table cellspacing="1" cellpadding="3" width="90%" align="center" border="0">
    <tbody>
        <tr>
            <td><span class="genmed"><strong>代码:</strong></span></td>
        </tr>
        <tr>
            <td class="code"><br />
            &nbsp; &nbsp; &lt;beans&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; ... <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;bean id="myTransactionManager" <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class="org.springframework.orm.hibernate.HibernateTransactionManager"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="sessionFactory"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ref bean="mySessionFactory"/&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;/bean&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;bean id="myProductServiceTarget" class="product.ProductServiceImpl"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="productDao"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ref bean="myProductDao"/&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;/bean&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;bean id="myProductService" <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="transactionManager"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ref bean="myTransactionManager"/&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="target"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ref bean="myProductServiceTarget"/&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name="transactionAttributes"&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;props&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;prop key="increasePrice*"&gt;PROPAGATION_REQUIRED&lt;/prop&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;prop key="someOtherBusinessMethod"&gt;PROPAGATION_MANDATORY&lt;/prop&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/props&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/property&gt; <br />
            &nbsp; &nbsp; &nbsp; &nbsp; &lt;/bean&gt; <br />
            &nbsp; &nbsp; &lt;/beans&gt; <br />
            &nbsp; &nbsp; </td>
        </tr>
    </tbody>
</table>
<span class="postbody"><br />
<br />
在没有其他AOP interceptor情况下，使用TransactionProxyFactoryBean是比较方便的。 <br />
事务划分一般是的业务层，而不是在DAO一层。 <br />
<br />
2.代理工厂返回的是接口AddressDao的应用，通过接口最终调用target的方法。 <br />
3.TransactionDefinition定义了所有的事务属性</span><span class="gensmall"><br />
</span><br />
<br />
<p id="TBPingURL">Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=396860</p>
<img src ="http://www.blogjava.net/terry711/aggbug/190168.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/terry711/" target="_blank">terryliu</a> 2008-04-01 17:49 <a href="http://www.blogjava.net/terry711/articles/190168.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转 Spring+Hibernate配置事务  </title><link>http://www.blogjava.net/terry711/articles/190159.html</link><dc:creator>terryliu</dc:creator><author>terryliu</author><pubDate>Tue, 01 Apr 2008 09:36:00 GMT</pubDate><guid>http://www.blogjava.net/terry711/articles/190159.html</guid><wfw:comment>http://www.blogjava.net/terry711/comments/190159.html</wfw:comment><comments>http://www.blogjava.net/terry711/articles/190159.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/terry711/comments/commentRss/190159.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/terry711/services/trackbacks/190159.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &lt;?xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"?&gt;&lt;beans&nbsp;xmlns="http://www.springframework.org/schema/beans"&nbsp;&nbsp;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&nbsp;&nb...&nbsp;&nbsp;<a href='http://www.blogjava.net/terry711/articles/190159.html'>阅读全文</a><img src ="http://www.blogjava.net/terry711/aggbug/190159.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/terry711/" target="_blank">terryliu</a> 2008-04-01 17:36 <a href="http://www.blogjava.net/terry711/articles/190159.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> Hibernate-Criteria Query </title><link>http://www.blogjava.net/terry711/articles/107352.html</link><dc:creator>terryliu</dc:creator><author>terryliu</author><pubDate>Thu, 29 Mar 2007 14:33:00 GMT</pubDate><guid>http://www.blogjava.net/terry711/articles/107352.html</guid><wfw:comment>http://www.blogjava.net/terry711/comments/107352.html</wfw:comment><comments>http://www.blogjava.net/terry711/articles/107352.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/terry711/comments/commentRss/107352.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/terry711/services/trackbacks/107352.html</trackback:ping><description><![CDATA[
		<div class="postTitle">
				<a href="http://blog.csdn.net/numen_wlm/archive/2006/06/28/846281.aspx">
						<img height="13" src="http://blog.csdn.net/images/zhuan.gif" width="15" border="0" /> Hibernate-Criteria Query</a>
		</div>
		<div class="postText">
				<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
						<span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria Query</span>
						<span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">通过面向对象化的设计，将数据查询条件封装为一个对象。简单来<span lang="EN-US"></span></span>
				</p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">讲，</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria Query</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">可以看作是传统</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的对象化表示，如：<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria criteria = session.createCriteria(User.</span><strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: " courier="">class</span></strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria.add(Expression.eq(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"name"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">,</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"Erica"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">)); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria.add(Expression.eq(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"sex"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">,</span><strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: " courier="">new </span></strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Integer(1))); </span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">这里的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">实例实际上是</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">SQL </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: CourierNew; mso-font-kerning: 0pt; mso-bidi-font-family: CourierNew">“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Select * from t_user where </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">name=</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: CourierNew; mso-font-kerning: 0pt; mso-bidi-font-family: CourierNew">’</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Erica</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: CourierNew; mso-font-kerning: 0pt; mso-bidi-font-family: CourierNew">’ </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">and sex=<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="1" unitname="”"></chmetcnv>1<span lang="EN-US" style="FONT-FAMILY: CourierNew; mso-hansi-font-family: " times="" new=""><span lang="EN-US">”</span></span></span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的封装（我们可以打开</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Hibernate </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">show_sql </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">选项，<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">以观察</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Hibernate</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">在运行期生成的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">语句）。<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Hibernate </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">在运行期会根据</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中指定的查询条件（也就是上面代码中通过<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria.add</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">方法添加的查询表达式）生成相应的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">语句。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">这种方式的特点是比较符合</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Java </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">程序员的编码习惯，并且具备清晰的可读性。正因<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">为此，不少</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">ORM</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">实现中都提供了类似的实现机制（如</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Apache OJB</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">）。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对于</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Hibernate</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的初学者，特别是对</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">了解有限的程序员而言，</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria Query </span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">无疑是上手的极佳途径，相对</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">HQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">，</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria Query</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">提供了更易于理解的查询手段，借<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">助</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">IDE</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Coding Assist</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">机制，</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的使用几乎不用太多的学习。<span lang="EN-US"></span></span></p>
				<p> <strong><span lang="EN-US" style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: " courier="">Criteria </span></strong><strong><span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体,Bold; mso-font-kerning: 0pt; mso-bidi-font-family: '宋体,Bold'">查询表达式<span lang="EN-US"></span></span></strong></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">本身只是一个查询容器，具体的查询条件需要通过</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria.add </span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">方法添加到</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">实例中。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">如前例所示，</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对象具体描述了查询条件。针对</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">SQL </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">语法，<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">提供了对应的查询限定机制，包括：<span lang="EN-US"></span></span></p>
				<p> <strong><span style="FONT-SIZE: 10pt; COLOR: #33339a; FONT-FAMILY: 宋体,Bold; mso-font-kerning: 0pt; mso-bidi-font-family: ">方法 描述<span lang="EN-US"></span></span></strong></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.eq </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">field = value</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">”表达式。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">如</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.eq(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"name"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">,</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"Erica"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">) </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.allEq </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">参数为一个</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Map</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对象，其中包含了多个属性－值对<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">应关系。相当于多个</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.eq</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">关系的叠加。<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.gt </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的 </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">“field &gt; value ” </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">表达式<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.ge </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的 </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">“field &gt;= value” </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">表达式<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.lt </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的 </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">“field &lt; value” </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">表达式<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.le </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的 </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">“field &lt;= value” </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">表达式<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.between </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的 </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">“between” </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">表达式<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">如下面的表达式表示年龄（</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">age</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">）位于</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">13</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">到</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">50</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">区</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">间内。<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.between(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"age"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">,</span><strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: " courier="">new </span></strong></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Integer(13),</span><strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: " courier="">new </span></strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Integer(50)); </span></p>
				<p> <span lang="EN-US" style="mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">表达式<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.in </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的 </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">”field in …” </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">表达式<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.eqProperty </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">用于比较两个属性之间的值，对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">field </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">= field</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">”。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">如：<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.eqProperty( </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"TUser.groupID"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">, </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"TGroup.id" </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.gtProperty </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">用于比较两个属性之间的值，对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">field </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">&gt; field</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">”。<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.geProperty </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">用于比较两个属性之间的值，对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">field </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">&gt;= field</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">”。<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.ltProperty </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">用于比较两个属性之间的值，对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">field </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">&lt; field</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">”。<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.leProperty </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">用于比较两个属性之间的值，对应</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">field </span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">&lt;= field</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">”。<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.and and</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">关系组合。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">如：<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.and( </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.eq(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"name"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">,</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"Erica"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">), </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.eq( </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"sex"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">, </span></p>
				<p> <strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: " courier="">new </span></strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Integer(1) </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">) </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.or or</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">关系组合。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">如：<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.or( </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.eq(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"name"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">,</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"Erica"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">), </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.eq(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"name"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">,</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"Emma"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">) </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression.sql </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">作为补充，本方法提供了原生</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">语法的支持。我<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">们可以通过这个方法直接通过</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">SQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">语句限定查询</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">条件。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">下面的代码返回所有名称以“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Erica</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">”起始的记录：<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Expression.sql( </span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: CourierNew; mso-font-kerning: 0pt; mso-bidi-font-family: CourierNew">“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">lower({alias}.name) like lower(?)</span><span style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: CourierNew; mso-font-kerning: 0pt; mso-bidi-font-family: CourierNew">”</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">, </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"Erica%"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">, </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Hibernate.STRING </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">); </span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">其中的“</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">{alias}</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">”将由</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Hibernate</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">在运行期使<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">用当前关联的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">POJO</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">别名替换。<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">注意</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Expression </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">各方法中的属性名参数（如</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">Express.eq</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中的第一个参数），这里<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">所谓属性名是</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana; mso-fareast-font-family: ">POJO</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">中对应实际库表字段的属性名（大小写敏感），而非库表中的实<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">际字段名称。<span lang="EN-US"></span></span></p>
				<p> <strong><span lang="EN-US" style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: " courier="">Criteria </span></strong><strong><span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体,Bold; mso-font-kerning: 0pt; mso-bidi-font-family: ">高级特性<span lang="EN-US"></span></span></strong></p>
				<p> <strong><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体,Bold; mso-font-kerning: 0pt; mso-bidi-font-family: ">限定返回的记录范围<span lang="EN-US"></span></span></strong></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">通过</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria. setFirstResult/setMaxResults </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">方法可以限制一次查询返回<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的记录范围</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">: </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria criteria = session.createCriteria(TUser.</span><strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: " courier="">class</span></strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: " courier="">//</span><span style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">限定查询返回检索结果中，从第一百条结果开始的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: " courier="">20</span><span style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">条记录<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria.setFirstResult(100); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria.setMaxResults(20); </span></p>
				<p> <strong><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体,Bold; mso-font-kerning: 0pt; mso-bidi-font-family: ">对查询结果进行排序<span lang="EN-US"></span></span></strong></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: " courier="">//</span><span style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">查询所有</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: " courier="">groupId=2</span><span style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的记录<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: " courier="">//</span><span style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">并分别按照姓名</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: " courier="">(</span><span style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">顺序</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: " courier="">)</span><span style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">和</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: " courier="">groupId</span><span style="FONT-SIZE: 10pt; COLOR: #3f7f5f; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">（逆序）排序<span lang="EN-US"></span></span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria criteria = session.createCriteria(TUser.</span><strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: " courier="">class</span></strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria.add(Expression.eq(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"groupId"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">,</span><strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #7f0055; FONT-FAMILY: " courier="">new </span></strong><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Integer(2))); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria.addOrder(Order.asc(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"name"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">)); </span></p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">criteria.addOrder(Order.desc(</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: #2a00ff; FONT-FAMILY: " courier="">"groupId"</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">)); </span></p>
				<p> </p>
				<p> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">作为一种对象化的查询封装模式，不过由于</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Hibernate</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">在实现过程中将精力<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">更加集中在</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">HQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">查询语言上，因此</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的功能实现还没做到尽善尽美（这点上，</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">OJB </span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">的</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Criteria </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">实现倒是值得借鉴），因此，在实际开发中，建议还是采用</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">Hibernate </span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">官<span lang="EN-US"></span></span></p>
				<p> <span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">方推荐的查询封装模式：</span><span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: " courier="">HQL</span><span style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 宋体; mso-hansi-font-family: ; mso-font-kerning: 0pt" times="" new="">。</span> </p>
		</div>
<img src ="http://www.blogjava.net/terry711/aggbug/107352.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/terry711/" target="_blank">terryliu</a> 2007-03-29 22:33 <a href="http://www.blogjava.net/terry711/articles/107352.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>