锘??xml version="1.0" encoding="utf-8" standalone="yes"?>91网站在线观看视频,香蕉加勒比综合久久,亚洲人成小说http://www.aygfsteel.com/DyEnigma/category/48719.html<font color="black">鐢ㄥ績鍘繪劅鍙?lt;/font>zh-cnThu, 26 Jan 2012 08:12:06 GMTThu, 26 Jan 2012 08:12:06 GMT60[搴旂敤]S2SH鍒嗛〉(Hibernate鍒嗛〉鏌ヨ)http://www.aygfsteel.com/DyEnigma/articles/352773.htmlDyEnigmaDyEnigmaTue, 21 Jun 2011 10:20:00 GMThttp://www.aygfsteel.com/DyEnigma/articles/352773.htmlhttp://www.aygfsteel.com/DyEnigma/comments/352773.htmlhttp://www.aygfsteel.com/DyEnigma/articles/352773.html#Feedback0http://www.aygfsteel.com/DyEnigma/comments/commentRss/352773.htmlhttp://www.aygfsteel.com/DyEnigma/services/trackbacks/352773.html 1 package cn.dy.dao; 2  3 import ...  闃呰鍏ㄦ枃

DyEnigma 2011-06-21 18:20 鍙戣〃璇勮
]]>
[灝忕煡璇哴Hibernate鏄犲皠鍏崇郴灝忚堪http://www.aygfsteel.com/DyEnigma/articles/351337.htmlDyEnigmaDyEnigmaMon, 30 May 2011 06:42:00 GMThttp://www.aygfsteel.com/DyEnigma/articles/351337.htmlhttp://www.aygfsteel.com/DyEnigma/comments/351337.htmlhttp://www.aygfsteel.com/DyEnigma/articles/351337.html#Feedback0http://www.aygfsteel.com/DyEnigma/comments/commentRss/351337.htmlhttp://www.aygfsteel.com/DyEnigma/services/trackbacks/351337.html闃呰鍏ㄦ枃

DyEnigma 2011-05-30 14:42 鍙戣〃璇勮
]]>
[灝忕煡璇哴Hibernate涓庢暟鎹簱浜や簰鏂瑰紡鍜孒ibernate甯哥敤鐨勫嚑涓柟娉?/title><link>http://www.aygfsteel.com/DyEnigma/articles/351167.html</link><dc:creator>DyEnigma</dc:creator><author>DyEnigma</author><pubDate>Fri, 27 May 2011 05:32:00 GMT</pubDate><guid>http://www.aygfsteel.com/DyEnigma/articles/351167.html</guid><wfw:comment>http://www.aygfsteel.com/DyEnigma/comments/351167.html</wfw:comment><comments>http://www.aygfsteel.com/DyEnigma/articles/351167.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/DyEnigma/comments/commentRss/351167.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/DyEnigma/services/trackbacks/351167.html</trackback:ping><description><![CDATA[<div><span style="color: #303030; font-family: 寰蔣闆呴粦; line-height: 18px; font-size: small; ">搴熻瘽涓嶅璇達紝鐩存帴鏀句唬鐮侊紝浜や簰鏂瑰紡錛?br /><br />絎竴縐嶏紝閫傚悎sql璇█姘村鉤姣旇緝楂樼殑浜虹敤<br /><br /><div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">HQL(Hibernate Query Language)</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="white-space: pre; "> </span>闈㈠悜瀵硅薄鐨勬煡璇㈣璦錛屼笌SQL涓嶅悓錛孒QL涓殑瀵硅薄鍚嶆槸鍖哄垎澶у皬鍐欑殑錛堥櫎浜咼AVA綾誨拰灞炴у叾浠栭儴鍒嗕笉鍖哄垎澶у皬鍐欙級錛汬QL涓煡鐨勬槸瀵硅薄鑰屼笉鏄拰琛紝騫朵笖鏀寔澶氭侊紱HQL涓昏閫氳繃Query鏉ユ搷浣滐紝Query鐨勫垱寤烘柟寮忥細</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="white-space: pre; "> </span>Query q = session.createQuery(hql);</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">eg錛?from Person</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">        from User user where user.name=:name</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">        from User user where user.name=:name and user.birthday < :birthday</div></div><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #000000; ">@SuppressWarnings(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">unchecked</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; ">@Override<br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; ">@Transactional(propagation </span><span style="color: #000000; ">=</span><span style="color: #000000; "> Propagation.NOT_SUPPORTED)<br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> List</span><span style="color: #000000; "><</span><span style="color: #000000; ">User</span><span style="color: #000000; ">></span><span style="color: #000000; "> check(String username, String email, String peopleId) {<br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; ">    String hql </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">from User where username=:uName or email=:email or peopleId=:PID</span><span style="color: #000000; ">"</span><span style="color: #000000; ">;<br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">    Query q </span><span style="color: #000000; ">=</span><span style="color: #000000; "> factory.getCurrentSession().createQuery(hql);<br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">    q.setString(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">uName</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, username);<br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">    q.setString(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">email</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, email);<br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">    q.setString(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">PID</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, peopleId);<br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; ">    List list </span><span style="color: #000000; ">=</span><span style="color: #000000; "> q.list();<br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> list;<br /></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">}</span></div><br />絎簩縐嶏紝鐭補錛屽伓sql璇█姘村鉤鏈夌偣嬈犵己錛岀敤榪欎釜鍚э紝""鍐呮槸琛ㄦ牸鐨勫瓧孌靛悕錛岃繖閲屽崈涓囪娉ㄦ剰錛屽瓧孌靛悕瑕佸拰hbm.xml鏂囦歡涓瓧孌靛悕澶у皬鍐欎竴鑷淬?br /><br /><div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Criteria</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="white-space: pre; "> </span>Criteria鏄竴縐嶆瘮HQL鏇撮潰鍚戝璞$殑鏌ヨ鏂瑰紡錛汣riteria鐨勫垱寤烘柟寮忥細</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="white-space: pre; "> </span>Criteria crit = session.createCriteria(DomainClass.class);</div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="white-space: pre; "> </span>綆鍗曞睘鎬ф潯浠跺錛歝riteria.add(Restrictions.eq(propertyName, value)), 榪欎釜Restrictions.eq灝辨槸QBC榪愮畻絎?/div><div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><span style="white-space: pre; "> </span>criteria.add(Restrictions.eqProperty(propertyName,otherPropertyName))</div></div><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #000000; ">@SuppressWarnings(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">unchecked</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; ">@Override<br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; ">@Transactional(propagation </span><span style="color: #000000; ">=</span><span style="color: #000000; "> Propagation.NOT_SUPPORTED)<br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> List</span><span style="color: #000000; "><</span><span style="color: #000000; ">User</span><span style="color: #000000; ">></span><span style="color: #000000; "> check(String username, String email, String peopleId) {<br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; ">    Criteria c </span><span style="color: #000000; ">=</span><span style="color: #000000; "> factory.getCurrentSession().createCriteria(User.</span><span style="color: #0000FF; ">class</span><span style="color: #000000; ">);<br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">    c.add(Restrictions.or(Restrictions.eq(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">userName</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, username),<br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">            Restrictions.or(Restrictions.eq(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">email</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, email), Restrictions<br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">                .eq(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">peopleId</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, peopleId))));<br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">    List list </span><span style="color: #000000; ">=</span><span style="color: #000000; "> c.list();<br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> list;<br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">}</span></div><div><br />鍙﹀綆鍗曚粙緇嶄竴涓婹BC榪愮畻絎?br /><br /><div><div>= Restrictions.eq() 絳変簬 </div><div><> Restrictions.not(Exprission.eq()) 涓嶇瓑浜?nbsp;</div><div>> Restrictions.gt() 澶т簬 </div><div>>= Restrictions.ge() 澶т簬絳変簬 </div><div>< Restrictions.lt() 灝忎簬 </div><div><= Restrictions.le() 灝忎簬絳変簬 </div><div>is null Restrictions.isnull() 絳変簬絀哄?nbsp;</div><div>is not null Restrictions.isNotNull() 闈炵┖鍊?nbsp;</div><div>like Restrictions.like() 瀛楃涓叉ā寮忓尮閰?nbsp;</div><div>and Restrictions.and() 閫昏緫涓?nbsp;</div><div>and Restrictions.conjunction() 閫昏緫涓?nbsp;</div><div>or Restrictions.or() 閫昏緫鎴?nbsp;</div><div>or Restrictions.disjunction() 閫昏緫鎴?nbsp;</div><div>not Restrictions.not() 閫昏緫闈?nbsp;</div><div>in(鍒楄〃) Restrictions.in() 絳変簬鍒楄〃涓殑鏌愪竴涓?nbsp;</div><div>ont in(鍒楄〃) Restrictions.not(Restrictions.in())涓嶇瓑浜庡垪琛ㄤ腑浠繪剰涓涓?nbsp;</div><div>between x and y Restrictions.between() 闂尯闂磝y涓殑浠繪剰鍊?nbsp;</div><div>not between x and y Restrictions.not(Restrictions..between()) 灝忎簬鍊糥鎴栬呭ぇ浜庡紋 </div></div><br />甯哥敤鐨勫嚑涓柟娉曪細</div>鍒嗛〉錛歴etFirstResult(num)錛屼粠絎琻um鏉¤褰曞紑濮嬶紝setMaxResults(num)錛屾誨叡num鏉¤褰曘?br />鏌ヨ錛歭ist();<br /><br />鍙﹀榪樻湁鎺掑簭<br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #000000; ">List cats </span><span style="color: #000000; ">=</span><span style="color: #000000; "> sess.createCriteria(Cat.</span><span style="color: #0000FF; ">class</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; ">    .add( Restrictions.like(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">name</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, </span><span style="color: #000000; ">"</span><span style="color: #000000; ">F%</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; ">    .addOrder( Order.asc(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">name</span><span style="color: #000000; ">"</span><span style="color: #000000; ">) )<br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; ">    .addOrder( Order.desc(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">age</span><span style="color: #000000; ">"</span><span style="color: #000000; ">) )<br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; ">    .setMaxResults(</span><span style="color: #000000; ">50</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">    .list();<br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">List cats </span><span style="color: #000000; ">=</span><span style="color: #000000; "> sess.createCriteria(Cat.</span><span style="color: #0000FF; ">class</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">    .add( Property.forName(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">name</span><span style="color: #000000; ">"</span><span style="color: #000000; ">).like(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">F%</span><span style="color: #000000; ">"</span><span style="color: #000000; ">) )<br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">    .addOrder( Property.forName(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">name</span><span style="color: #000000; ">"</span><span style="color: #000000; ">).asc() )<br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; ">    .addOrder( Property.forName(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">age</span><span style="color: #000000; ">"</span><span style="color: #000000; ">).desc() )<br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">    .setMaxResults(</span><span style="color: #000000; ">50</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">    .list();</span></div><br />鏈鍚庯紝榪樻槸寤鴻鐢℉ibernate瀹樻柟鎺ㄨ崘鐨凥QL鏌ヨ鏂瑰紡銆?br /></span></div><img src ="http://www.aygfsteel.com/DyEnigma/aggbug/351167.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/DyEnigma/" target="_blank">DyEnigma</a> 2011-05-27 13:32 <a href="http://www.aygfsteel.com/DyEnigma/articles/351167.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>[鍘熷垱]S2SH涔嬫嫓甯堣冮獙錛峧Query琛ㄥ崟楠岃瘉http://www.aygfsteel.com/DyEnigma/articles/351047.htmlDyEnigmaDyEnigmaThu, 26 May 2011 02:10:00 GMThttp://www.aygfsteel.com/DyEnigma/articles/351047.htmlhttp://www.aygfsteel.com/DyEnigma/comments/351047.htmlhttp://www.aygfsteel.com/DyEnigma/articles/351047.html#Feedback0http://www.aygfsteel.com/DyEnigma/comments/commentRss/351047.htmlhttp://www.aygfsteel.com/DyEnigma/services/trackbacks/351047.html闃呰鍏ㄦ枃

DyEnigma 2011-05-26 10:10 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 盐边县| 岳普湖县| 上栗县| 乌恰县| 平山县| 来凤县| 庐江县| 清镇市| 仪陇县| 麻江县| 固原市| 新营市| 玛沁县| 霸州市| 宝清县| 丰镇市| 尼木县| 榆林市| 荣昌县| 平和县| 鲁山县| 盘锦市| 巨鹿县| 临桂县| 石台县| 基隆市| 揭西县| 游戏| 阳东县| 邢台市| 璧山县| 藁城市| 潜江市| 临洮县| 沁水县| 永城市| 新丰县| 自贡市| 平昌县| 湟源县| 扶风县|