锘??xml version="1.0" encoding="utf-8" standalone="yes"?>色播亚洲视频在线观看,亚洲国产一区二区三区在线播放,一区二区三区我不卡http://www.aygfsteel.com/yesjoy/category/7321.html<font color="red">鈽?lt;/font><font color="blue">鎬誨湪鐖北 鎵€浠ヨ壈杈?鎬誨湪瀵繪ⅵ 鎵€浠ヨ嫤鐥?lt;/font><font color="red">鈽?lt;/font>zh-cnTue, 31 Aug 2010 08:05:17 GMTTue, 31 Aug 2010 08:05:17 GMT60Hibernate涓瑿ascade鍜孖nverse http://www.aygfsteel.com/yesjoy/articles/80164.html鈽厃esjoy鈽?/dc:creator>鈽厃esjoy鈽?/author>Thu, 09 Nov 2006 07:26:00 GMThttp://www.aygfsteel.com/yesjoy/articles/80164.htmlhttp://www.aygfsteel.com/yesjoy/comments/80164.htmlhttp://www.aygfsteel.com/yesjoy/articles/80164.html#Feedback0http://www.aygfsteel.com/yesjoy/comments/commentRss/80164.htmlhttp://www.aygfsteel.com/yesjoy/services/trackbacks/80164.html錛戙€佸埌搴曞湪鍝敤cascade="..."錛?/p>

cascade灞炴€у茍涓嶆槸澶氬澶氬叧緋諱竴瀹氳鐢ㄧ殑錛屾湁浜嗗畠鍙槸璁╂垜浠湪鎻掑叆鎴栧垹闄ゅ鍍忔椂鏇存柟渚夸竴浜涳紝鍙鍦╟ascade鐨勬簮澶翠笂鎻掑叆鎴栨槸鍒犻櫎錛屾墍鏈塩ascade鐨勫叧緋誨氨浼氳鑷繁鍔ㄧ殑鎻掑叆鎴栨槸鍒犻櫎銆備究鏄負浜嗚兘姝g‘鐨刢ascade錛寀nsaved-value鏄釜寰堥噸瑕佺殑灞炴€с€侶ibernate閫氳繃榪欎釜灞炴€ф潵鍒ゆ柇涓€涓璞″簲璇ave榪樻槸update錛屽鏋滆繖涓璞$殑id鏄痷nsaved-value鐨勮瘽錛岄偅璇存槑榪欎釜瀵硅薄涓嶆槸persistence object瑕乻ave錛坕nsert)錛涘鏋渋d鏄潪unsaved-value鐨勮瘽錛岄偅璇存槑榪欎釜瀵硅薄鏄痯ersistence object錛堟暟鎹簱涓凡瀛樺湪錛夛紝鍙update灝辮浜嗐€俿aveOrUpdate鏂規硶鐢ㄧ殑涔熸槸榪欎釜鏈哄埗銆?/p>

錛掋€佸埌搴曞湪鍝敤inverse="ture"?

inverse灞炴€ч粯璁ゆ槸false鐨勶紝灝辨槸璇村叧緋葷殑涓ょ閮芥潵緇存姢鍏崇郴銆傝繖涓剰鎬濆氨鏄錛屽鏈変竴涓猄tudent, Teacher鍜孴eacherStudent琛紝Student鍜孴eacher鏄瀵瑰瀵瑰鍏崇郴錛岃繖涓叧緋葷敱TeacherStudent榪欎釜琛ㄦ潵琛ㄧ幇銆傞偅涔堜粈涔堟椂鍊欐彃鍏ユ垨鍒犻櫎TeacherStudent琛ㄤ腑鐨勮褰曟潵緇存姢鍏崇郴鍛紵鍦ㄧ敤hibernate鏃訛紝鎴戜滑涓嶄細鏄劇ず鐨勫TeacherStudent琛ㄥ仛鎿嶄綔銆傚TeacherStudent鐨勬搷浣滄槸hibernate甯垜浠仛鐨勩€俬ibernate灝辨槸鐪媓bm鏂囦歡涓寚瀹氱殑鏄?璋?緇存姢鍏崇郴錛岄偅涓湪鎻掑叆鎴栧垹闄?璋?鏃訛紝灝變細澶勫彂瀵瑰叧緋昏〃鐨勬搷浣溿€傚墠鎻愭槸"璋?榪欎釜瀵硅薄宸茬粡鐭ラ亾榪欎釜鍏崇郴浜嗭紝灝辨槸璇村叧緋誨彟涓€澶寸殑瀵硅薄宸茬粡set鎴栨槸add鍒?璋?榪欎釜瀵硅薄閲屾潵浜嗐€傚墠闈㈣榪噄nverse榛樿鏄痜alse錛屽氨鏄叧緋葷殑涓ょ閮界淮鎶ゅ叧緋伙紝瀵瑰叾涓換涓€涓搷浣滈兘浼氬鍙戝琛ㄧ郴琛ㄧ殑鎿嶄綔銆傚綋鍦ㄥ叧緋葷殑涓€澶達紝濡係tudent涓殑bag鎴杝et涓敤浜唅nverse錛?true"鏃訛紝閭e氨浠h〃鍏崇郴鏄敱鍙︿竴鍏崇淮鎶ょ殑錛圱eacher錛夈€傚氨鏄褰撹繖鎻掑叆Student鏃訛紝涓嶄細鎿嶄綔TeacherStudent琛紝鍗充嬌Student宸茬粡鐭ラ亾浜嗗叧緋匯€傚彧鏈夊綋Teacher鎻掑叆鎴栧垹闄ゆ椂鎵嶄細澶勫彂瀵瑰叧緋昏〃鐨勬搷浣溿€傛墍浠ワ紝褰撳叧緋葷殑涓ゅご閮界敤inverse="true"鏄笉瀵圭殑錛屽氨浼氬鑷翠換浣曟搷浣滈兘涓嶅鍙戝鍏崇郴琛ㄧ殑鎿嶄綔銆傚綋涓ょ閮芥槸inverse="false"鎴栨槸default鍊兼槸錛屽湪浠g爜瀵瑰叧緋繪樉紺虹殑緇存姢涔熸槸涓嶅鐨勶紝浼氬鑷村湪鍏崇郴琛ㄤ腑鎻掑叆涓ゆ鍏崇郴銆?/p>

鍦ㄤ竴瀵瑰鍏崇郴涓璱nverse灝辨洿鏈夋剰涔変簡銆傚湪澶氬澶氫腑錛屽湪鍝inverse="true"鏁堟灉宸笉澶氾紙鍦ㄦ晥鐜囦笂錛夈€備絾鏄湪涓€瀵瑰涓紝濡傛灉瑕佷竴鏂圭淮鎶ゅ叧緋伙紝灝變細浣垮湪鎻掑叆鎴栨槸鍒犻櫎"涓€"鏂規椂鍘籾pdate"澶?鏂圭殑姣忎竴涓笌榪欎釜"涓€"鐨勫璞℃湁鍏崇郴鐨勫璞°€傝€屽鏋滆"澶?鏂歸潰緇存姢鍏崇郴鏃跺氨涓嶄細鏈塽pdate鎿嶄綔錛屽洜涓哄叧緋誨氨鏄湪澶氭柟鐨勫璞′腑鐨勶紝鐩存寚鎻掑叆鎴栨槸鍒犻櫎澶氭柟瀵硅薄灝辮浜嗐€傚綋鐒惰繖鏃朵篃瑕侀亶鍘?澶?鏂圭殑姣忎竴涓璞℃樉紺虹殑鎿嶄綔淇叧緋葷殑鍙樺寲浣撶幇鍒癉B涓€備笉綆℃€庢牱璇達紝榪樻槸璁?澶?鏂圭淮鎶ゅ叧緋繪洿鐩磋涓€浜涖€?/p>

錛撱€乧ascade鍜宨nverse鏈変粈涔堝尯鍒紵

鍙互榪欐牱鐞嗚В錛宑ascade瀹氫箟鐨勬槸鍏崇郴涓ょ瀵硅薄鍒板璞$殑綰ц仈鍏崇郴錛涜€宨nverse瀹氫箟鐨勬槸鍏崇郴鍜屽璞$殑綰ц仈鍏崇郴銆?/p>

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=741468

璇﹁錛歨ttp://www.bczs.net/xml/2005/12/21/4473293.xml

http://welcomejianghome.spaces.msn.com/blog/cns!3196CAE67CDF2316!149.entry

all : 鎵€鏈夋儏鍐典笅鍧囪繘琛屽叧鑱旀搷浣溿€?
none錛氭墍鏈夋儏鍐典笅鍧囦笉榪涜鍏寵仈鎿嶄綔銆傝繖鏄粯璁ゅ€箋€?
save-update:鍦ㄦ墽琛宻ave/update/saveOrUpdate鏃惰繘琛屽叧鑱旀搷浣溿€?
delete錛氬湪鎵цdelete鏃惰繘琛屽叧鑱旀搷浣溿€?

all鐨勬剰鎬濇槸save-update + delete
all-delete-orphan 鐨勬剰鎬濇槸褰撳璞″浘涓駭鐢熷鍎胯妭鐐規椂,鍦ㄦ暟鎹簱涓垹闄よ鑺傜偣
all姣旇緝濂界悊瑙?涓句釜渚嬪瓙璇翠竴涓媋ll-delete-orphan:
Category涓嶪tem鏄竴瀵瑰鐨勫叧緋?涔熷氨鏄Category綾諱腑鏈変釜Set綾誨瀷鐨勫彉閲廼tems.
涓句釜渚嬪瓙,鐜癷tems涓瓨涓や釜Item, item1,item2,濡傛灉瀹氫箟鍏崇郴涓篴ll-delete-orphan
褰搃tems涓垹闄ゆ帀涓€涓猧tem(姣斿鐢╮emove()鏂規硶鍒犻櫎item1),閭d箞琚垹闄ょ殑Item綾誨疄渚?
灝嗗彉鎴愬鍎胯妭鐐?褰撴墽琛宑ategory.update(),鎴杝ession.flush()鏃?
hibernate鍚屾緙撳瓨鍜屾暟鎹簱,浼氭妸鏁版嵁搴撲腑item1瀵瑰簲鐨勮褰曞垹鎺?



]]>
DetachedCriteria鍏寵仈鏌ヨhttp://www.aygfsteel.com/yesjoy/articles/76346.html鈽厃esjoy鈽?/dc:creator>鈽厃esjoy鈽?/author>Fri, 20 Oct 2006 03:10:00 GMThttp://www.aygfsteel.com/yesjoy/articles/76346.htmlhttp://www.aygfsteel.com/yesjoy/comments/76346.htmlhttp://www.aygfsteel.com/yesjoy/articles/76346.html#Feedback0http://www.aygfsteel.com/yesjoy/comments/commentRss/76346.htmlhttp://www.aygfsteel.com/yesjoy/services/trackbacks/76346.htmlSpring+Hibernate3鐨勬鏋朵腑鐢ㄥ埌浜嗗叧鑱旀煡璇?br />
琛║ser錛欰ddress鏄竴瀵瑰鐨勫叧緋?br />UserBean涓湁涓€涓猘ddresses鐨凷et

鐜板湪瑕佹煡璇㈠嚭榪欐牱鐨刄ser錛屾嫢鏈堿ddress涓棬鐗宒oorplate涓?642"鐨刄ser錛?br />鐜板湪DB涓彧鏈変竴涓繖鏍風殑User錛岃繖涓猆ser鎷ユ湁闂ㄧ墝doorplate涓?642"鐨凙ddress浜斾釜~~

鍒涘緩DetachedCriteria 鐨勮鍙ュ涓嬶細

DetachedCriteria detachedCriteria = DetachedCriteria.forClass(User.class);
detachedCriteria.createCriteria("鎵?).add(Restrictions.like("doorplate","642"));

瀹為檯鏌ヨ璇彞濡備笅錛?br />

List list = getHibernateTemplate().findByCriteria(queryCriteria);

鐞嗚涓婃煡璇㈠嚭鏉ョ殑list搴旇User鐨刲ist鏄?

鎬葷粨濡備笅
1錛?br />DetachedCriteria addressCriteria = DetachedCriteria.forClass(User.class).createCriteria("addresses");
addressCriteria.add(Restrictions.eq("doorplate","642")):

2錛?br />DetachedCriteria addressCriteria = DetachedCriteria.forClass(User.class).createAlias("addresses", "a");
addressCriteria.add(Restrictions.eq("a.doorplate","642")):


]]>
case when then...鐨勭敤娉?/title><link>http://www.aygfsteel.com/yesjoy/articles/75000.html</link><dc:creator>鈽厃esjoy鈽?/dc:creator><author>鈽厃esjoy鈽?/author><pubDate>Fri, 13 Oct 2006 06:56:00 GMT</pubDate><guid>http://www.aygfsteel.com/yesjoy/articles/75000.html</guid><wfw:comment>http://www.aygfsteel.com/yesjoy/comments/75000.html</wfw:comment><comments>http://www.aygfsteel.com/yesjoy/articles/75000.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yesjoy/comments/commentRss/75000.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yesjoy/services/trackbacks/75000.html</trackback:ping><description><![CDATA[ <br /> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <span style="FONT-WEIGHT: bold; COLOR: #800000">1</span> <span style="COLOR: #000000">銆?/span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #ff00ff">sum</span> <span style="COLOR: #000000">(t1.useHours)聽</span> <span style="COLOR: #0000ff">as</span> <span style="COLOR: #000000">聽hours1聽</span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000">聽Table1聽t1聽</span> <span style="COLOR: #0000ff">where</span> <span style="COLOR: #000000">聽condition1<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="FONT-WEIGHT: bold; COLOR: #800000">2</span> <span style="COLOR: #000000">銆?/span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #ff00ff">sum</span> <span style="COLOR: #000000">(t2.useHours)聽</span> <span style="COLOR: #0000ff">as</span> <span style="COLOR: #000000">聽hours2聽</span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000">聽Table2聽t2聽</span> <span style="COLOR: #0000ff">where</span> <span style="COLOR: #000000">聽condition2<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />涓婇潰涓ゆ潯璇彞鏄湪鍚屼竴涓〃涓牴鎹笉鍚屾潯浠舵煡璇㈠嚭涓や釜緇撴灉錛屾瘮濡傦細<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />璇彞1寰楀埌緇撴灉涓?0<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />璇彞2寰楀埌緇撴灉涓?0<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />鎴戠幇鍦ㄥ笇鏈涘緱鍒頒笅闈㈢殑緇撴灉錛?br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />hours1聽hours2聽<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="FONT-WEIGHT: bold; COLOR: #800000">10</span> <span style="COLOR: #000000">聽聽聽聽聽</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">20</span> <span style="COLOR: #000000"> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />鐩存帴鍦ㄥ啓sql鏃跺仛涓€涓嬫暟鎹繛緇撳氨鍙互浜?br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000"> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />(</span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #ff00ff">sum</span> <span style="COLOR: #000000">(t1.useHours)聽</span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000">聽Table1聽t1聽</span> <span style="COLOR: #0000ff">where</span> <span style="COLOR: #000000">聽condition1)聽hours1,<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />(</span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #ff00ff">sum</span> <span style="COLOR: #000000">(t2.useHours)聽</span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000">聽Table2聽t2聽</span> <span style="COLOR: #0000ff">where</span> <span style="COLOR: #000000">聽condition2)聽hours2<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />褰撶劧涔熷彲浠ュ弬鑰冨涓嬬殑鍐欐硶:<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />hql聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">聽"</span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #ff00ff">sum</span> <span style="COLOR: #000000">(</span> <span style="COLOR: #ff00ff">case</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">when</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">聽whereSql1聽</span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #0000ff">then</span> <span style="COLOR: #000000">聽(pro.preengageHoursOrSamples</span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">pro.adjustOfHours)聽</span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000">聽</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">0</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">end</span> <span style="COLOR: #000000">)聽</span> <span style="COLOR: #0000ff">as</span> <span style="COLOR: #000000">聽a,";<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />hql聽</span> <span style="COLOR: #808080">+=</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #ff00ff">sum</span> <span style="COLOR: #000000">(</span> <span style="COLOR: #ff00ff">case</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">when</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">聽whereSql2 </span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #0000ff">then</span> <span style="COLOR: #000000">聽(pro.preengageHoursOrSamples</span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">pro.adjustOfHours)聽</span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000">聽</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">0</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">end</span> <span style="COLOR: #000000">)聽</span> <span style="COLOR: #0000ff">as</span> <span style="COLOR: #000000">聽b,";<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />hql聽</span> <span style="COLOR: #808080">+=</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #ff00ff">sum</span> <span style="COLOR: #000000">(</span> <span style="COLOR: #ff00ff">case</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">when</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">聽whereSql3 </span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #0000ff">then</span> <span style="COLOR: #000000">聽(pro.preengageHoursOrSamples</span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">pro.adjustOfHours)聽</span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000">聽</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">0</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">end</span> <span style="COLOR: #000000">)聽</span> <span style="COLOR: #0000ff">as</span> <span style="COLOR: #000000">聽c";<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />hql聽</span> <span style="COLOR: #808080">+=</span> <span style="COLOR: #000000">聽"聽</span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000">聽PreengageOddPO聽pro聽</span> <span style="COLOR: #0000ff">where</span> <span style="COLOR: #000000">聽</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">1</span> <span style="COLOR: #808080">=</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">1</span> <span style="COLOR: #000000">";</span> </div> <img src ="http://www.aygfsteel.com/yesjoy/aggbug/75000.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/yesjoy/" target="_blank">鈽厃esjoy鈽?/a> 2006-10-13 14:56 <a href="http://www.aygfsteel.com/yesjoy/articles/75000.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>hibernate涓嬌鐢ㄦ湰鍦皊ql鐨勬柟娉?/title><link>http://www.aygfsteel.com/yesjoy/articles/74616.html</link><dc:creator>鈽厃esjoy鈽?/dc:creator><author>鈽厃esjoy鈽?/author><pubDate>Wed, 11 Oct 2006 08:56:00 GMT</pubDate><guid>http://www.aygfsteel.com/yesjoy/articles/74616.html</guid><wfw:comment>http://www.aygfsteel.com/yesjoy/comments/74616.html</wfw:comment><comments>http://www.aygfsteel.com/yesjoy/articles/74616.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yesjoy/comments/commentRss/74616.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yesjoy/services/trackbacks/74616.html</trackback:ping><description><![CDATA[ <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">浣跨敤鏂規硶:<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />String聽hql聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">聽"</span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000">聽{pro.</span> <span style="COLOR: #808080">*</span> <span style="COLOR: #000000">}聽</span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000">聽T_ES_PreengageOdd聽pro聽</span> <span style="COLOR: #0000ff">where</span> <span style="COLOR: #000000">聽</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">1</span> <span style="COLOR: #808080">=</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">1</span> <span style="COLOR: #000000">";<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />SQLQuery聽sqlQuery聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">聽this.getSession().createSQLQuery(hql);<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />sqlQuery.addEntity("pro",PreengageOddPO.class);<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />List聽list聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">聽sqlQuery.list();<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽list;<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />璇存槑:T_ES_PreengageOdd鏄綘鏁版嵁搴撲腑瀹為檯鐨勮〃鍚?<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />PreengageOddPO鏄綘PO瀵硅薄,瀹冨搴旀槧灝勬垚琛═_ES_PreengageOdd.<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> </div> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">聽聽聽聽聽聽聽聽SQLQuery聽sqlQuery1聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">聽this.getSession().createSQLQuery(<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽"</span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000">聽{ep.</span> <span style="COLOR: #808080">*</span> <span style="COLOR: #000000">}聽</span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000">聽T_ES_Equipment聽ep聽</span> <span style="COLOR: #0000ff">where</span> <span style="COLOR: #000000">聽ep.CHNNAME聽</span> <span style="COLOR: #808080">like</span> <span style="COLOR: #000000">聽:equipname聽</span> <span style="COLOR: #808080">and</span> <span style="COLOR: #000000">聽ep.equip_id聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">:equipid");<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽sqlQuery1.addEntity("ep",聽EquipmentPO.class);<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽sqlQuery1.setString("equipname",聽"</span> <span style="COLOR: #808080">%</span> <span style="COLOR: #000000">緋葷粺</span> <span style="COLOR: #808080">%</span> <span style="COLOR: #000000">");<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽sqlQuery1.setString("equipid",聽"</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">11020874</span> <span style="COLOR: #000000">");<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽List聽result聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">聽sqlQuery1.list();<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">聽(result聽</span> <span style="COLOR: #808080">!=</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">null</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #808080">&&</span> <span style="COLOR: #000000">聽result.size()聽</span> <span style="COLOR: #808080">></span> <span style="COLOR: #000000">聽</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">0</span> <span style="COLOR: #000000">)聽{<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">for</span> <span style="COLOR: #000000">聽(</span> <span style="FONT-WEIGHT: bold; COLOR: #000000">int</span> <span style="COLOR: #000000">聽i聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">聽</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">0</span> <span style="COLOR: #000000">;聽i聽</span> <span style="COLOR: #808080"><</span> <span style="COLOR: #000000">聽result.size();聽i</span> <span style="COLOR: #808080">++</span> <span style="COLOR: #000000">)聽{<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽EquipmentPO聽equipmentPO聽</span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">聽(EquipmentPO)聽result.get(i);<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽System.out.println("equipname</span> <span style="COLOR: #808080">===></span> <span style="COLOR: #000000">"聽</span> <span style="COLOR: #808080">+</span> <span style="COLOR: #000000">聽equipmentPO.getChineseName());<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽聽聽聽聽}<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽}<br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />鎵撳嵃緇撴灉:</span> <span style="COLOR: #000000"> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />equipname</span> <span style="COLOR: #808080">===></span> <span style="COLOR: #000000">姘旇川緋葷粺</span> </div> <img src ="http://www.aygfsteel.com/yesjoy/aggbug/74616.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/yesjoy/" target="_blank">鈽厃esjoy鈽?/a> 2006-10-11 16:56 <a href="http://www.aygfsteel.com/yesjoy/articles/74616.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Hibernate QBC鐨勬煡璇㈡柟寮忕殑鎬葷粨http://www.aygfsteel.com/yesjoy/articles/65782.html鈽厃esjoy鈽?/dc:creator>鈽厃esjoy鈽?/author>Fri, 25 Aug 2006 06:24:00 GMThttp://www.aygfsteel.com/yesjoy/articles/65782.htmlhttp://www.aygfsteel.com/yesjoy/comments/65782.htmlhttp://www.aygfsteel.com/yesjoy/articles/65782.html#Feedback0http://www.aygfsteel.com/yesjoy/comments/commentRss/65782.htmlhttp://www.aygfsteel.com/yesjoy/services/trackbacks/65782.html

聽1 聽聽聽聽聽聽聽聽Criteria聽criteria聽 = 聽this.getSession().createCriteria(EquipmentPO.class);
聽2 聽聽聽聽聽聽聽聽criteria. add (Restrictions.allEq(new聽Map(Restrictions.eq("equipID",new聽String(" 11020449 ")),Restrictions.eq("equipID",new聽String(" 11020449 "))));聽聽聽聽聽聽聽聽
聽3 聽聽聽聽聽聽聽聽 // 娉ㄦ剰錛歜etween鏌ヨ鏉′歡鍙В閲婁負鏌ヨEquipmentPO瀵硅薄涓殑equipID灞炴€у€煎湪new聽String(" 11020449 ")鍜宯ew聽String(" 11030137 ")涔嬮棿鐨勬墍鏈夎褰曞€鹼紙鍖呭惈涓や釜绔偣錛?br /> 聽4 聽聽聽聽聽聽聽聽criteria. add (Restrictions. between ("equipID",new聽String(" 11020449 "),new聽String(" 11030137 ")));
聽5 聽聽聽聽聽聽聽聽 // 鏌ヨ緇撴灉鍒楄〃璁板綍鎸夌収equipID鐨勫睘鎬у€兼潵鍗囧簭鎺掑簭
聽6 聽聽聽聽聽聽聽聽criteria.addOrder( Order . asc ("equipID")); // 闄嶅簭鏂瑰紡涓猴細 Order . desc ("equipID")聽聽聽聽聽聽聽聽
聽7 聽聽聽聽聽聽聽聽 // 閫氳繃EquipmentPO瀵硅薄鐨勪富閿甶d鏉ユ煡璇?br /> 聽8 聽聽聽聽聽聽聽聽criteria. add (Restrictions.idEq("402882ac0d3f7ca8010d3f7ef869000b"));聽聽聽聽聽聽聽聽
聽9 聽聽聽聽聽聽聽聽Restrictions. like (fieldName,聽" % "聽 + 聽para + 聽" % ")
10 聽聽聽聽聽聽聽聽 // 浣跨敤ilike鏂瑰紡榪涜妯$硦鏌ヨ
11 聽聽聽聽聽聽聽聽criteria. add (Restrictions.ilike("equipID",new聽String(" % 11020 % ")));
12 聽聽聽聽聽聽聽聽 // ilike鐨刬鍗砳gnore涔嬫剰,鎵€浠ヨ繖閲屾煡璇㈠嚭englishName鍊間負"Optima聽XL聽100K聽Ultracentrifuge"錛堝拷鐣ュぇ灝忓啓錛夌殑璁板綍
13 聽聽聽聽聽聽聽聽criteria. add (Restrictions.ilike("englishName",new聽String("Optima聽XL聽100K聽Ultracentrifuge"),MatchMode.ANYWHERE)); // 榪欓噷聽聽聽聽聽聽聽聽
14 聽聽聽聽聽聽聽聽 // 浣跨敤in鏂瑰紡鏈変袱縐嶅艦寮忥紝鍗蟲暟緇勬垨鑰匔ollection鐨勬柟寮忥紝鍙弬鑰冨涓嬩袱涓疄渚?br /> 15 聽聽聽聽聽聽聽聽 // criteria. add (Restrictions. in ("equipID",new聽String [] {" 11020449 "," 11020450 "})); // 鏁扮粍鍙傛暟
16 聽聽聽聽聽聽聽聽Collection聽col聽 = 聽new聽ArrayList();
17 聽聽聽聽聽聽聽聽col. add (new聽String(" 11020449 "));
18 聽聽聽聽聽聽聽聽col. add (new聽String(" 11020450 "));
19 聽聽聽聽聽聽聽聽col. add (new聽String(" 11020874 "));
20 聽聽聽聽聽聽聽聽criteria. add (Restrictions. in ("equipID",col)); // Collection鍙傛暟聽聽聽聽聽聽聽聽
21 聽聽聽聽聽聽聽聽 // 浣跨敤isEmpty / isNotEmpty鏂瑰紡鐢ㄦ潵鍒ゆ柇EquipmentPO瀵硅薄涓殑Collection綾誨瀷鐨勫睘鎬ф槸鍚︿負絀虹殑鎵€鏈夎褰?br /> 22 聽聽聽聽聽聽聽聽 // EquipmentPO瀵硅薄涓畾涔夊睘鎬rivate聽 Set 聽equipFunctionDevelopPOs聽 = 聽new聽HashSet();聽 // 聽璁懼鍔熻兘寮€鍙戝璞?br /> 23 聽聽聽聽聽聽聽聽criteria. add (Restrictions.isEmpty("equipFunctionDevelopPOs"));
24 聽聽聽聽聽聽聽聽criteria. add (Restrictions.isNotEmpty("equipFunctionDevelopPOs"));
25 聽聽聽聽聽聽聽聽 // 浣跨敤isNull鏂瑰紡鏌ヨ鍑烘墍鏈塻choolID灞炴€ф病鏈夊€肩殑璁板綍銆傝鏄庯細Restrictions.isNull鍒ゆ柇灞炴€ф槸鍚︿負絀猴紝涓虹┖榪斿洖true錛屽弽涔嬭繑鍥瀎alse
26 聽聽聽聽聽聽聽聽criteria. add (Restrictions. isNull ("schoolID"));
27 聽聽聽聽聽聽聽聽criteria. add (Restrictions.isNotNull("schoolID"));聽聽聽聽聽聽聽聽
28 聽聽聽聽聽聽聽聽 // 涓嶳estrictions.eq姝eソ鐩稿弽錛岃〃紺轟笉瀛樺湪( not in )
29 聽聽聽聽聽聽聽聽criteria. add (Restrictions. not (Restrictions.eq("equipID",new聽String(" 11020449 "))));
30 聽聽聽聽聽聽聽聽 // 浣跨敤Restrictions.sizeEq鏂瑰紡鐢ㄦ潵鏌ヨEquipmentPO瀵硅薄涓殑Collection綾誨瀷鐨勫睘鎬quipFunctionDevelopPOs鐨剆ize涓?鐨勬墍鏈夎褰?br /> 31 聽聽聽聽聽聽聽聽criteria. add (Restrictions.sizeEq("equipFunctionDevelopPOs", 1 ));聽聽聽聽聽聽聽聽
32 聽聽聽聽聽聽聽聽 // 浣跨敤sql闄愬畾鐨勬煡璇€€傛敞鎰弡alias}.chnname榪欓噷鏄寚瀹為檯琛ㄤ腑鐨勫瓧孌靛悕鑰岄潪灞炴€у悕錛堜笉鍖哄垎澶у皬鍐欙級
33 聽聽聽聽聽聽聽聽criteria. add (Restrictions.sqlRestriction("{alias}.chnname聽 like 聽(?)"," % 鐢?/span> % ",Hibernate.STRING));
34 聽聽聽聽聽聽聽聽criteria. add (Restrictions.sqlRestriction("{alias}.ENGNAME聽 like 聽(?)"," % ptima % ",Hibernate.STRING));
35 聽聽聽聽聽聽聽聽 // 濡傛灉鏈夊涓煡璇㈡潯浠訛紝姣斿between瀛愬彞鐨勬煡璇㈠垯濡備笅錛毬犅犅犅犅犅犅犅?br /> 36 聽聽聽聽聽聽聽聽BigDecimal [] 聽unitPrice聽 = 聽{new聽BigDecimal( 402514 ),new聽BigDecimal( 614891 )};
37 聽聽聽聽聽聽聽聽Type [] 聽types聽 = 聽{Hibernate.BIG_DECIMAL,Hibernate.BIG_DECIMAL};
38 聽聽聽聽聽聽聽聽criteria. add (Restrictions.sqlRestriction("{alias}.unit_price聽 between 聽(?)聽 and 聽(?)",unitPrice,types));
39 聽聽聽聽聽聽聽聽List聽list聽 = 聽criteria.list();
40 聽聽聽聽聽聽聽聽System.out.println("size ===> "聽 + 聽list.size());
41 聽聽聽聽聽聽聽聽 return 聽list;


]]>
鎬葷粨浠ヤ笅hibernate鏌ヨ璇█鐨勭敤娉?/title><link>http://www.aygfsteel.com/yesjoy/articles/37847.html</link><dc:creator>鈽厃esjoy鈽?/dc:creator><author>鈽厃esjoy鈽?/author><pubDate>Tue, 28 Mar 2006 09:58:00 GMT</pubDate><guid>http://www.aygfsteel.com/yesjoy/articles/37847.html</guid><wfw:comment>http://www.aygfsteel.com/yesjoy/comments/37847.html</wfw:comment><comments>http://www.aygfsteel.com/yesjoy/articles/37847.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yesjoy/comments/commentRss/37847.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yesjoy/services/trackbacks/37847.html</trackback:ping><description><![CDATA[ <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <span style="COLOR: #0000ff"><?</span> <span style="COLOR: #ff00ff">xml聽version="1.0"</span> <span style="COLOR: #0000ff">?></span> <span style="COLOR: #000000"> <br /> </span> <span style="COLOR: #0000ff"><!</span> <span style="COLOR: #ff00ff">DOCTYPE聽hibernate-mapping聽PUBLIC<br />聽聽聽聽"-//Hibernate/Hibernate聽Mapping聽DTD//EN"<br />聽聽聽聽"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"聽</span> <span style="COLOR: #0000ff">></span> <span style="COLOR: #000000"> <br /> <br /> </span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">hibernate-mapping聽</span> <span style="COLOR: #ff0000">package</span> <span style="COLOR: #0000ff">="gov.cfte.object.hibernate.model"</span> <span style="COLOR: #0000ff">></span> <span style="COLOR: #000000"> <br />聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">class聽</span> <span style="COLOR: #ff0000">name</span> <span style="COLOR: #0000ff">="ObjectLog"</span> <span style="COLOR: #ff0000">聽table</span> <span style="COLOR: #0000ff">="OBJECT_LOG"</span> <span style="COLOR: #0000ff">></span> <span style="COLOR: #000000"> <br />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">id聽</span> <span style="COLOR: #ff0000">column</span> <span style="COLOR: #0000ff">="ID"</span> <span style="COLOR: #ff0000">聽name</span> <span style="COLOR: #0000ff">="Id"</span> <span style="COLOR: #ff0000">聽type</span> <span style="COLOR: #0000ff">="string"</span> <span style="COLOR: #ff0000">聽length</span> <span style="COLOR: #0000ff">="32"</span> <span style="COLOR: #0000ff">></span> <span style="COLOR: #000000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">generator聽</span> <span style="COLOR: #ff0000">class</span> <span style="COLOR: #0000ff">="net.sf.hibernate.id.UUIDHexGenerator"</span> <span style="COLOR: #ff0000">聽</span> <span style="COLOR: #0000ff">/></span> <span style="COLOR: #000000"> <br />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"></</span> <span style="COLOR: #800000">id</span> <span style="COLOR: #0000ff">></span> <span style="COLOR: #000000">聽<br />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">property<br />聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #ff0000">column</span> <span style="COLOR: #0000ff">="TYPE_ID"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽length</span> <span style="COLOR: #0000ff">="32"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽name</span> <span style="COLOR: #0000ff">="TypeId"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽not-null</span> <span style="COLOR: #0000ff">="false"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽type</span> <span style="COLOR: #0000ff">="string"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">/></span> <span style="COLOR: #000000"> <br />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">property<br />聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #ff0000">column</span> <span style="COLOR: #0000ff">="OPTIME"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽length</span> <span style="COLOR: #0000ff">="26"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽name</span> <span style="COLOR: #0000ff">="Optime"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽not-null</span> <span style="COLOR: #0000ff">="false"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽type</span> <span style="COLOR: #0000ff">="timestamp"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">/></span> <span style="COLOR: #000000"> <br />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">property<br />聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #ff0000">column</span> <span style="COLOR: #0000ff">="USER_ID"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽length</span> <span style="COLOR: #0000ff">="32"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽name</span> <span style="COLOR: #0000ff">="UserId"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽not-null</span> <span style="COLOR: #0000ff">="false"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽type</span> <span style="COLOR: #0000ff">="string"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">/></span> <span style="COLOR: #000000"> <br />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">property<br />聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #ff0000">column</span> <span style="COLOR: #0000ff">="OPINFO"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽length</span> <span style="COLOR: #0000ff">="32"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽name</span> <span style="COLOR: #0000ff">="Opinfo"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽not-null</span> <span style="COLOR: #0000ff">="false"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽type</span> <span style="COLOR: #0000ff">="string"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">/></span> <span style="COLOR: #000000"> <br />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">property<br />聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #ff0000">column</span> <span style="COLOR: #0000ff">="RECORDINFO"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽length</span> <span style="COLOR: #0000ff">="1024"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽name</span> <span style="COLOR: #0000ff">="Recordinfo"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽not-null</span> <span style="COLOR: #0000ff">="false"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽type</span> <span style="COLOR: #0000ff">="string"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">/></span> <span style="COLOR: #000000"> <br />聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff"><</span> <span style="COLOR: #800000">property<br />聽聽聽聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #ff0000">column</span> <span style="COLOR: #0000ff">="IP"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽length</span> <span style="COLOR: #0000ff">="32"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽name</span> <span style="COLOR: #0000ff">="Ip"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽not-null</span> <span style="COLOR: #0000ff">="false"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽聽聽聽type</span> <span style="COLOR: #0000ff">="string"</span> <span style="COLOR: #ff0000"> <br />聽聽聽聽聽聽聽聽聽</span> <span style="COLOR: #0000ff">/></span> <span style="COLOR: #000000"> <br />聽聽聽聽</span> <span style="COLOR: #0000ff"></</span> <span style="COLOR: #800000">class</span> <span style="COLOR: #0000ff">></span> <span style="COLOR: #000000"> <br /> </span> <span style="COLOR: #0000ff"></</span> <span style="COLOR: #800000">hibernate-mapping</span> <span style="COLOR: #0000ff">></span> <span style="COLOR: #000000"> <br /> </span> </div> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">this</span> <span style="COLOR: #000000">.getHibernateTemplate().find(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">from聽ObjectLog</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);<br /></span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">this</span> <span style="COLOR: #000000">.getHibernateTemplate().find(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">from聽ObjectLog聽c聽where聽c.Opinfo聽=聽?</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,聽queryCondition);</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">鏍規嵁鎿嶄綔鏂瑰紡鏉ョ簿紜煡璇?宸叉祴璇曢€氳繃)</span> <span style="COLOR: #008000"> <br /> </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">this</span> <span style="COLOR: #000000">.getHibernateTemplate().find(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">from聽ObjectLog聽c聽where聽c.Opinfo聽like聽?</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,聽</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">%</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">queryCondition</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">%</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">鏍規嵁鎿嶄綔鏂瑰紡鏉ユā緋婃煡璇?宸叉祴璇曢€氳繃)</span> <span style="COLOR: #008000"> <br /> </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽</span> <span style="COLOR: #0000ff">this</span> <span style="COLOR: #000000">.getHibernateTemplate().find(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">from聽ObjectLog聽c聽where聽c.TypeId=?聽and聽c.Opinfo聽like聽?</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #0000ff">new</span> <span style="COLOR: #000000">聽Object[]{typeId,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">%</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">queryCondition</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">%</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">});</span> </div> <img src ="http://www.aygfsteel.com/yesjoy/aggbug/37847.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/yesjoy/" target="_blank">鈽厃esjoy鈽?/a> 2006-03-28 17:58 <a href="http://www.aygfsteel.com/yesjoy/articles/37847.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍏充簬hibernate鐨勯厤緗枃浠秇ibernate.cfg.xml鐨勮緇嗚В閲?/title><link>http://www.aygfsteel.com/yesjoy/articles/31750.html</link><dc:creator>鈽厃esjoy鈽?/dc:creator><author>鈽厃esjoy鈽?/author><pubDate>Tue, 21 Feb 2006 02:33:00 GMT</pubDate><guid>http://www.aygfsteel.com/yesjoy/articles/31750.html</guid><wfw:comment>http://www.aygfsteel.com/yesjoy/comments/31750.html</wfw:comment><comments>http://www.aygfsteel.com/yesjoy/articles/31750.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/yesjoy/comments/commentRss/31750.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/yesjoy/services/trackbacks/31750.html</trackback:ping><description><![CDATA[<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><SPAN style="COLOR: #0000ff"><?</SPAN><SPAN style="COLOR: #ff00ff">xml version="1.0"</SPAN><SPAN style="COLOR: #0000ff">?></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff"><!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"<BR>"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">hibernate-configuration</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000"><BR>    </SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">session-factory</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="dialect"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">org.hibernate.dialect.MySQLDialect</SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">涓€涓狧ibernate Dialect綾誨悕鍏佽Hibernate閽堝鐗瑰畾鐨勫叧緋繪暟鎹簱鐢熸垚浼樺寲鐨凷QL<BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="connection.driver_class"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">com.mysql.jdbc.Driver</SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">jdbc椹卞姩綾?BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="connection.url"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">jdbc:mysql://localhost/student</SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">jdbc URL<BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="connection.username"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">root</SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">鏁版嵁搴撶敤鎴?BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="connection.password"</SPAN><SPAN style="COLOR: #0000ff">></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">鏁版嵁搴撶敤鎴峰瘑鐮?BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="hibernate.connection.pool.size"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">10</SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">榪炴帴姹犲閲忎笂闄愭暟鐩?BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="hibernate.show_sql"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">true</SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">杈撳嚭鎵€鏈塖QL璇彞鍒版帶鍒跺彴<BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="jdbc.fetch_size"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">50</SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">闈為浂鍊鹼紝鎸囧畾JDBC鎶撳彇鏁伴噺鐨勫ぇ灝?BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">property </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="jdbc.batch_size"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">20</SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">property</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000">闈為浂鍊鹼紝鍏佽Hibernate浣跨敤JDBC2鐨勬壒閲忔洿鏂?BR></SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000">property name="jdbc.use_scrollable_resultset">false</property</SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000">鍏佽Hibernate浣跨敤JDBC2鐨勫彲婊氬姩緇撴灉闆? 鍙湁鍦ㄤ嬌鐢ㄧ敤鎴鋒彁渚涚殑JDBC榪炴帴鏃訛紝榪欎釜閫夐」鎵嶆槸蹇呰鐨? 鍚﹀垯Hibernate浼氫嬌鐢ㄨ繛鎺ョ殑鍏冩暟鎹?BR><BR><BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">mapping </SPAN><SPAN style="COLOR: #ff0000">resource</SPAN><SPAN style="COLOR: #0000ff">="eqzhou/test/Student.hbm.xml"</SPAN><SPAN style="COLOR: #0000ff">/></SPAN><SPAN style="COLOR: #000000">鏄犲皠瀹氫箟鏂囦歡<BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">mapping </SPAN><SPAN style="COLOR: #ff0000">resource</SPAN><SPAN style="COLOR: #0000ff">="eqzhou/test/Huzhao.hbm.xml"</SPAN><SPAN style="COLOR: #0000ff">/></SPAN><SPAN style="COLOR: #000000">鏄犲皠瀹氫箟鏂囦歡<BR></SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000">mapping resource="eqzhou/test/User.hbm.xml"/</SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000">鏄犲皠瀹氫箟鏂囦歡<BR></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">mapping </SPAN><SPAN style="COLOR: #ff0000">resource</SPAN><SPAN style="COLOR: #0000ff">="eqzhou/test/Dep.hbm.xml"</SPAN><SPAN style="COLOR: #0000ff">/></SPAN><SPAN style="COLOR: #000000">鏄犲皠瀹氫箟鏂囦歡<BR><BR>    </SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">session-factory</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">hibernate-configuration</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN></DIV><img src ="http://www.aygfsteel.com/yesjoy/aggbug/31750.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/yesjoy/" target="_blank">鈽厃esjoy鈽?/a> 2006-02-21 10:33 <a href="http://www.aygfsteel.com/yesjoy/articles/31750.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>J2EE欏圭洰涓殑鏁版嵁鎸佷箙灞傝璁?http://www.aygfsteel.com/yesjoy/articles/30018.html鈽厃esjoy鈽?/dc:creator>鈽厃esjoy鈽?/author>Thu, 09 Feb 2006 05:15:00 GMThttp://www.aygfsteel.com/yesjoy/articles/30018.htmlhttp://www.aygfsteel.com/yesjoy/comments/30018.htmlhttp://www.aygfsteel.com/yesjoy/articles/30018.html#Feedback0http://www.aygfsteel.com/yesjoy/comments/commentRss/30018.htmlhttp://www.aygfsteel.com/yesjoy/services/trackbacks/30018.htmlJ2EE欏圭洰涓殑鏁版嵁鎸佷箙灞傝璁??XML:NAMESPACE PREFIX = O />

鍒樿壋闇?錛?/SPAN>鍞愬北宸ヤ笟瀛︽牎 鍞愬北 063000錛?/SPAN>

鏁版嵁鎸佷箙灞傜殑璁捐鐩爣鏄負鏁翠釜欏圭洰鎻愪緵涓€涓珮灞傘€佺粺涓€銆佸畨鍏ㄥ拰騫跺彂鐨勬暟鎹寔涔呮満鍒躲€傚畬鎴愬鍚勭鏁版嵁榪涜鎸佷箙鍖栫殑緙栫▼宸ヤ綔錛屽茍涓虹郴緇熶笟鍔¢€昏緫灞傛彁渚涙湇鍔°€傛暟鎹寔涔呭眰鎻愪緵浜嗘暟鎹闂柟娉曪紝鑳藉浣垮叾瀹冪▼搴忓憳閬垮厤鎵嬪伐緙栧啓紼嬪簭璁塊棶鏁版嵁鎸佷箙灞?Persistene layer)錛屼嬌鍏朵笓娉ㄤ簬涓氬姟閫昏緫鐨勫紑鍙戯紝騫朵笖鑳藉鍦ㄤ笉鍚岄」鐩腑閲嶇敤鏄犲皠妗嗘灦錛屽ぇ澶х畝鍖栦簡鏁版嵁澧炪€佸垹銆佹敼銆佹煡絳夊姛鑳界殑寮€鍙戣繃紼嬶紝鍚屾椂鍙堜笉涓уけ澶氬眰緇撴瀯鐨勫ぉ鐒朵紭鍔匡紝緇ф壙寤剁畫J2EE鐗規湁鐨勫彲浼哥緝鎬у拰鍙墿灞曟€с€?O:P>

1 鏁版嵁鎸佷箙灞傚強ORM鏄犲皠妗嗘灦

絎旇€呬粠浜嬬殑欏圭洰涓殑鏁版嵁鎸佷箙灞傦紝鏄熀浜嶫2EE浣撶郴緇撴瀯錛屽茍閲囩敤浜咹ibernate浣滀負鎸佷箙鏄犲皠妗嗘灦銆?O:P>

Hibernate鏄竴縐嶆柊鐨凮RM鏄犲皠宸ュ叿錛屾槸JDBC鐨勮交閲忕駭鐨勫璞″皝瑁呫€侶ibernate鍙互鐢ㄥ湪JDBC鍙互浣跨敤鐨勪換浣曞満鍚堬紝渚嬪Java搴旂敤紼嬪簭鐨勬暟鎹簱璁塊棶浠g爜錛孌AO鎺ュ彛鐨勫疄鐜扮被錛岀敋鑷沖彲浠ユ槸BMP閲岄潰鐨勮闂暟鎹簱鐨勪唬鐮併€侶ibernate涓嶄粎鎻愪緵浜嗕粠Java綾誨埌鏁版嵁琛ㄤ箣闂寸殑鏄犲皠錛屼篃鎻愪緵浜嗘暟鎹煡璇㈠拰鎭㈠鏈哄埗銆傜浉瀵逛簬浣跨敤JDBC鍜孲QL鏉ユ墜宸ユ搷浣滄暟鎹簱錛屼嬌鐢℉ibernate錛屽彲浠ュぇ澶у噺灝戞搷浣滄暟鎹簱鐨勫伐浣滈噺銆?

Hibernate鏄竴涓拰JDBC瀵嗗垏鍏寵仈鐨勩€佺嫭绔嬬殑瀵硅薄鎸佷箙灞傛鏋訛紝鍙互鎼厤鍚勭App Server銆乄eb Server銆丒JB Container鍏卞悓浣跨敤錛孒ibernate鐨勫吋瀹規€т粎鍚孞DBC椹卞姩銆佸簳灞傛暟鎹簱浜у搧闂存湁涓€瀹氱殑鍏崇郴錛屼絾鏄拰浣跨敤瀹冪殑Java紼嬪簭銆丄pp Server娌℃湁浠諱綍鍏崇郴錛屼篃涓嶅瓨鍦ㄥ吋瀹規€ч棶棰樸€傝€屼笖浜嬪疄琛ㄦ槑Hibernate鍙互鍜屽縐峎eb鏈嶅姟鍣ㄦ垨鑰呭簲鐢ㄦ湇鍔″櫒鑹ソ闆嗘垚錛屽浠婂凡緇忔敮鎸佸嚑涔庢墍鏈夌殑嫻佽鐨勬暟鎹簱鏈嶅姟鍣紙杈?6縐嶏級銆?O:P>

鍦ㄨ緝涓哄父鐢ㄧ殑鏁版嵁鎸佷箙鏂規涓紝Hibernate鏃犵枒鏄渶浼樼鐨勶紝涓嬮潰鏄鍚勭鎸佷箙鏂規鐨勬瘮杈冦€?O:P>

嫻佽鐨勬暟鎹寔涔呭眰鏋舵瀯錛?O:P>

Business Layer <-> Session Bean <-> Entity Bean <-> DB

涓轟簡瑙e喅鎬ц兘闅滅鐨勬浛浠f灦鏋勶細

Business Layer <-> DAO <-> JDBC <-> DB

浣跨敤Hibernate鏉ユ彁楂樹笂闈㈡灦鏋勭殑寮€鍙戞晥鐜囩殑鏋舵瀯錛?O:P>

Business Layer <-> DAO <-> Hibernate <-> DB

鎴戜滑灝變笂闈?涓灦鏋勬潵浣滃涓嬪垎鏋愩€?O:P>

(1)鍐呭瓨娑堣€楋細閲囩敤JDBC鐨勬灦鏋勬棤鐤戞槸鏈€鐪佸唴瀛樼殑錛孒ibernate鐨勬灦鏋勬涔嬶紝EB鐨勬灦鏋勬渶宸€?/SPAN>

(2)榪愯鏁堢巼錛氬鏋淛DBC鐨勪唬鐮佸啓鐨勯潪甯鎬紭鍖栵紝閭d箞JDBC鏋舵瀯榪愯鏁堢巼鏈€楂橈紝浣嗘槸瀹為檯欏圭洰涓紝榪欎竴鐐瑰嚑涔庡仛涓嶅埌錛岃繖闇€瑕佺▼搴忓憳闈炲父綺鵑€欽DBC錛岃繍鐢˙atch璇彞錛岃皟鏁碢reapredStatement鐨凚atch Size鍜孎etch Size絳夊弬鏁幫紝浠ュ強鍦ㄥ繀瑕佺殑鎯呭喌涓嬮噰鐢ㄧ粨鏋滈泦cache絳夌瓑銆傝€屼竴鑸儏鍐典笅紼嬪簭鍛樻槸鍋氫笉鍒拌繖涓€鐐圭殑銆傚洜姝ibernate鏋舵瀯琛ㄧ幇鍑烘渶蹇殑榪愯鏁堢巼銆侲B鐨勬灦鏋勬晥鐜囦細宸殑寰堣繙銆?/SPAN>

(3)寮€鍙戞晥鐜囷細鍦ㄦ湁Eclipse銆丣Builder絳夊紑鍙戝伐鍏風殑鏀寔涓嬶紝瀵逛簬綆€鍗曠殑欏圭洰錛孍B鏋舵瀯寮€鍙戞晥鐜囨渶楂橈紝JDBC嬈′箣錛孒ibernate鏈€宸€備絾鏄湪澶х殑欏圭洰錛岀壒鍒槸鎸佷箙灞傚叧緋繪槧灝勫緢澶嶆潅鐨勬儏鍐典笅錛孒ibernate鏁堢巼楂樼殑鎯婁漢錛孞DBC嬈′箣錛岃€孍B鏋舵瀯寰堝彲鑳戒細澶辮觸銆?/SPAN>

2 鏁版嵁鎸佷箙灞傝璁?/FONT>

澶嶆潅鎬ф槸搴旂敤寮€鍙戣繃紼嬩腑鏈€浠や漢澶寸柤鐨勪竴涓棶棰樸€傛瘡褰撳湪涓€涓簲鐢ㄤ腑澧炲姞涓€涓姛鑳芥椂錛屽畠鐨勫鏉傛€ч€氬父鍛堝嚑浣曠駭鐨勫闀褲€傝繖縐嶅鏉傛€у線寰€瀵艱嚧紼嬪簭鐨勫紑鍙戞棤娉曞啀緇х畫涓嬪幓銆傝繖涔熸槸鐜板湪涓轟粈涔堣澶氬簲鐢ㄥ彧鏈?SPAN lang=EN-US>Beta鐗堟湰鑰屾病鏈夋寮忕増鐨勫師鍥犮€?SPAN style="mso-spacerun: yes"> 

涓撳灝嗗簲鐢ㄥ紑鍙戣繃紼嬩駭鐢熺殑澶嶆潅鎬у垎涓轟袱綾伙紝鍗抽潪鏈川鐨勶紙accidental錛夊拰鏈川鐨勶紙essential錛夈€傛湰璐ㄧ殑澶嶆潅鎬ф槸瀵逛簬瑙e喅鐩爣闂鎵€蹇呯劧浜х敓鐨勫鏉傛€э紝闈炴湰璐ㄧ殑澶嶆潅鎬ф槸鐢變簬閫夋嫨浜嗕笉閫傚綋鐨勫紑鍙戝伐鍏峰拰璁捐宸ュ叿鑰屼駭鐢熺殑澶嶆潅鎬с€傚浜庝竴涓姛鑳界‘瀹氱殑紼嬪簭鏉ヨ錛屾湰璐ㄧ殑澶嶆潅鎬ф槸紜畾鐨勶紝鑰岄潪鏈川鐨勫鏉傛€у垯鏄病鏈夐檺鍒剁殑銆傚洜姝わ紝涓€涓簲鐢ㄧ殑寮€鍙戣鎯寵緝欏哄埄鍦板彇寰楁垚鍔燂紝灝遍渶瑕佸敖鍙兘鍦板噺灝戦潪鏈川鐨勫鏉傛€с€?O:P>

璁捐妯″紡浣夸漢浠彲浠ユ洿鍔犵畝鍗曟柟渚垮湴澶嶇敤鎴愬姛鐨勮璁″拰浣撶郴緇撴瀯銆傚皢宸茶瘉瀹炵殑鎶€鏈〃榪版垚璁捐妯″紡錛屼篃浼氫嬌鏂扮郴緇熷紑鍙戣€呮洿鍔犲鏄撶悊瑙e叾璁捐鎬濊礬銆?SPAN lang=EN-US>

琛¢噺涓€涓郴緇熶紭縐€涓庡惁鐨勫叧閿洜绱狅紝闄や簡鑳藉婊¤凍鐢ㄦ埛闇€姹傚榪樻湁濡備笅鏂歸潰錛氶鍏堟槸鐏墊椿鎬с€傜伒媧繪€ф剰鎸囪繖縐嶇粨鏋勬垨妯″紡涓嶄緷璧栦簬浠諱綍瀹為檯搴旂敤錛屽簲璇ヤ笌鎿嶄綔緋葷粺銆佸簲鐢ㄧ▼搴忔棤鍏熾€傛彁渚涚嫭绔嬬殑緇撴瀯錛屽彲浠ユ彁渚涙渶澶х殑閲嶇敤銆傚叾嬈℃槸鍙墿灞曟€с€傞殢鐫€涓氬姟鐨勬墿灞曪紝鏂扮殑涓氬姟涓嶆柇澧炲姞錛屼笟鍔¢€昏緫鑷劧澧炲姞錛岀郴緇熷繀鐒朵細榪涜淇敼鎴栨坊鍔犵浉搴斿姛鑳芥ā鍧椼€傚啀嬈℃槸鍙厤緗€с€傛渶鍚庢槸瀹夊叏鎬с€?SPAN lang=EN-US>

鏁版嵁鎸佷箙灞傜殑璁捐閲囩撼浜嗗縐嶈璁℃ā寮忥紝鏈€澶ч檺搴︾殑闄嶄綆浜嗙郴緇熷唴閮ㄥ悇妯″潡銆佸瓙緋葷粺闂寸殑鑰﹀悎鎬э紝浣垮緱緋葷粺鐩稿鏄撲簬鎵╁睍錛屽茍涓旇兘澶熷湪榪涜鏀瑰彉鏃訛紝淇濊瘉鎸佷箙灞傜殑涓氬姟閫昏緫灞傜浉瀵圭ǔ瀹氾紝鍩烘湰涓嶉渶瑕佸洜鎸佷箙灞傜殑璋冩暣鏀瑰彉鑰岃繘琛岄€昏緫灞傜殑鍙樺姩銆?SPAN lang=EN-US>

絎旇€呭湪欏圭洰涓噰鐢ㄤ簡濡備笅璁捐妯″紡銆?SPAN lang=EN-US>

2.1 鏁翠綋鏋舵瀯鈥斺€擬VC妯″紡錛堟ā鍨?瑙嗗浘-鎺у埗鍣級

妯″瀷錛圡odel錛夛細妯″瀷鍖呭惈瀹屾垚浠誨姟鎵€闇€瑕佺殑鎵€鏈夌殑琛屼負鍜屾暟鎹€傚湪鏁版嵁鎸佷箙灞備腑錛屾ā鍨嬪嵆涓哄€煎璞′互鍙婃暟鎹闂璞°€?O:P>

瑙嗗浘錛圴iew錛夛細鏁版嵁鎸佷箙灞備腑錛岃鍥懼氨鏄寔涔呭眰鍚屽叾瀹冨眰榪涜鏁版嵁浜ゆ崲鐨勫€煎璞★紙Transfer Object錛夊拰瑙嗗浘鍔╂墜瀵硅薄銆?O:P>

鎺у埗鍣紙Controller錛夛細鎸佷箙灞傛墍闇€鐨勬帶鍒剁浉瀵圭畝鍗曪紝鍥犳闆嗘垚鍒頒簡鎺у埗浠g悊涓€?O:P>

鎸佷箙灞傛暣浣撻噰鐢?SPAN lang=EN-US>MVC妯″紡錛屼嬌寰楁暣涓暟鎹寔涔呭眰鐨勫疄鐜伴儴鍒嗕笌欏圭洰鐨勪笟鍔¢€昏緫閮ㄥ垎闅旂寮€鏉ワ紝鑳藉瀹炵幇瀵規帴鍙d綔澶х殑淇敼鑰屼笉闇€瑕佸鐩稿簲鐨勬ā鍨嬭繘琛屼慨鏀廣€傚彟澶栵紝鎸佷箙灞傛煇瀛愮郴緇熷彂鐢熷彉鍖栨椂錛屼笉浼氬獎鍝嶅埌鍏跺畠瀛愮郴緇熴€傛湁鍒╀簬鎻愰珮緋葷粺鐨勭ǔ瀹氭€с€佸彲緇存姢鎬с€?/SPAN>

2.2 鍊煎璞℃ā寮忥紙Value Object Pattern錛?/SPAN>

鍊煎璞$敤鏉ュ皝瑁呬笟鍔″璞°€傜浉搴旂殑鏂規硶璋冪敤鏄緗紙getter錛夊拰媯€绱紙setter錛夊€煎璞°€傚畠鏄換鎰忕殑鍙覆琛屽寲鐨凧ava瀵硅薄錛屽綋瀹㈡埛绔疊ean璇鋒眰涓氬姟鏁版嵁鏃訛紝璇ean鍙互鏋勯€犲€煎璞★紝鐢ㄥ睘鎬у€兼潵濉厖錛屽茍鎸夌収鍊兼妸瀹冧紶閫掔粰瀹㈡埛绔€?O:P>

鍦ㄧ瑪鑰呭紑鍙戦」鐩殑鏁版嵁鎸佷箙灞備綋緋葷粨鏋勪腑錛屽€煎璞′富瑕佸簲鐢ㄥ湪瀛愮郴緇熼棿浼犻€掋€佷氦鎹㈡暟鎹紙Transfer Object錛夊拰鏄犲皠鏁版嵁琛ㄤ袱涓柟闈紙Persistent Object錛夈€?O:P>

鍦ㄥ悇瀛愮郴緇熼棿榪涜鏁版嵁浼犻€掑拰鏁版嵁浜ゆ崲鏃訛紝浣跨敤鍊煎璞℃ā寮忚兘澶熸渶澶у寲鍦伴檷浣庣郴緇熼棿鏁版嵁浼犻€掔殑寮€閿€銆傚湪榪欑絳栫暐涓嬩紶閫掔殑鏄璞¤€屼笉鍐嶆槸涓€涓釜鐨勬湁鎰忎箟鐨勬暟鎹紝浣垮緱緋葷粺鍦ㄨ繘琛屾墿鍏呫€佷慨鏀規椂錛屽悇瀛愮郴緇熼棿鏁版嵁浼犻€掗儴鍒嗕笉浼氬彈鍒板獎鍝嶏紝鍥犱負鍚勫瓙緋葷粺浠呴渶瑕佸叧蹇冩槸鍚︽湁鍊煎璞¤浼犻€掞紝鑰屽茍涓嶅幓鍏沖績浼犻€掔殑鍒板簳鏄粈涔堟暟鎹€?SPAN lang=EN-US>

鍦ㄦ槧灝勬暟鎹簱琛ㄦ椂錛屽€煎璞$被鍙婂叾瀛愮被鎵€鏋勬垚鐨勬爲褰㈢粨鏋勮鐢ㄦ潵鏄犲皠涓€涓暟鎹簱琛紝璇ョ戶鎵挎爲閫氳繃XML閰嶇疆鏂囦歡瀵瑰簲鏁版嵁搴撲腑鐨勫崟涓〃錛岃繖浣垮緱鏈€搴曞眰鐨勫叧緋誨瀷鐨勬暟鎹簱琛ㄧ粨鏋勮兘澶熼潰鍚戝璞℃ā鍨嬫墍闅愯棌錛屽彟澶栵紝鐢變簬闈㈠悜瀵硅薄璁捐鏂規硶涓被鐨勫彲緇ф壙鎬э紝閲囩敤緇ф壙鏍戝搴斾竴涓〃鐨勭瓥鐣ヤ嬌寰楄鏄犲皠絳栫暐鏋佹槗鎵╁睍錛屽茍涓旇兘澶熷皢涓€涓鏉傜殑鏁版嵁琛ㄨ漿鍖栨垚鑻ュ共綆€鍗曠殑鍊煎璞℃潵琛ㄧず錛屾彁楂樹簡緋葷粺鐨勫彲緇存姢鎬у拰鍙慨鏀規€с€?O:P>

2.3 鏁版嵁璁塊棶瀵硅薄錛圖AO錛?/SPAN>

鏍規嵁鏁版嵁婧愪笉鍚岋紝鏁版嵁璁塊棶涔熶笉鍚屻€傛牴鎹瓨鍌ㄧ殑綾誨瀷(鍏崇郴鏁版嵁搴撱€侀潰鍚戝璞℃暟鎹簱絳?鍜屼緵搴斿晢涓嶅悓錛屾寔涔呮€у瓨鍌?姣斿鏁版嵁搴?鐨勮闂樊鍒篃寰堝ぇ銆傚綋涓氬姟緇勪歡鎴栬〃紺虹粍浠墮渶瑕佽闂煇鏁版嵁婧愭椂錛屽畠浠彲浠ヤ嬌鐢ㄥ悎閫傜殑API鏉ヨ幏寰楄繛鎺ユ€э紝浠ュ強鎿嶄綔璇ユ暟鎹簮銆備絾鏄湪榪欎簺緇勪歡涓寘鍚繛鎺ユ€у拰鏁版嵁璁塊棶浠g爜浼氬紩鍏ヨ繖浜涚粍浠跺強鏁版嵁婧愬疄鐜頒箣闂寸殑绱у瘑鑰﹀悎銆傜粍浠朵腑榪欑被浠g爜渚濊禆鎬т嬌搴旂敤紼嬪簭浠庢煇縐嶆暟鎹簮榪佺Щ鍒板叾瀹冪綾葷殑鏁版嵁婧愬皢鍙樺緱闈炲父楹葷儲鍜屽洶闅撅紝褰撴暟鎹簮鍙樺寲鏃訛紝緇勪歡涔熼渶瑕佹敼鍙橈紝浠ヤ究浜庤兘澶熷鐞嗘柊綾誨瀷鐨勬暟鎹簮銆?O:P>

絎旇€呭紑鍙戦」鐩殑鏁版嵁鎸佷箙灞備嬌鐢ㄦ暟鎹闂璞?SPAN lang=EN-US>(DAO)鏉ユ娊璞″拰灝佽鎵€鏈夊鏁版嵁婧愮殑璁塊棶銆侱AO綆$悊鐫€涓庢暟鎹簮鐨勮繛鎺ヤ互渚夸簬媯€绱㈠拰瀛樺偍鏁版嵁錛孌AO瀹炵幇浜嗙敤鏉ユ搷浣滄暟鎹簮鐨勮闂満鍒訛紝鍐呴儴灝佽浜嗗Hibenernate鏁版嵁鎿嶇旱銆佷簨鍔″鐞嗐€佷細璇濈鐞嗙瓑API鐨勫皝瑁呫€傚鐣屼緷璧栦簬DAO鐨勪笟鍔$粍浠朵負鍏跺鎴風浣跨敤DAO鎻愪緵浜嗘洿綆€鍗曠殑鎺ュ彛錛孌AO瀹屽叏鍚戝鎴風闅愯棌浜嗘暟鎹簮瀹炵幇緇嗚妭銆傜敱浜庡綋浣庡眰鏁版嵁婧愬疄鐜板彉鍖栨椂錛孌AO鍚戝鎴風鎻愪緵鐨勬帴鍙d笉浼氬彉鍖栵紝閲囩敤璇ヨ璁℃ā寮忓厑璁窪AO璋冩暣鍒頒笉鍚岀殑瀛樺偍妯″紡錛岃€屼笉浼氬獎鍝嶅叾瀹㈡埛绔垨涓氬姟緇勪歡錛屽嵆浣垮皢鏉ヤ笉鍐嶉噰鐢℉ibernate浣滀負鍏崇郴鏄犲皠妗嗘灦錛屼笂灞傚鎴風涔熶笉浼氬彈鍒頒換浣曞獎鍝嶃€傚彟澶栵紝DAO榪樺厖褰撶粍浠跺拰鏁版嵁婧愪箣闂寸殑閫傞厤鍣ㄧ殑瑙掕壊銆?O:P>

鏁版嵁鎸佷箙灞傞€氳繃璋冩暣鎶借薄宸ュ巶(Abstract Factory)妯″紡鍜屽伐鍘傛柟娉?Factory Method) 妯″紡(榪欎簩涓垱寤哄瀷妯″紡鐨勫疄鐜拌鎯呭弬瑙丟oF鐨?lt;璁捐妯″紡>)錛?錛屼嬌DAO妯″紡杈懼埌浜嗗緢楂樼殑鐏墊椿搴︺€?O:P>

褰撳簳灞傚瓨鍌ㄩ殢鐫€瀹炵幇鐨勫彉鍖栬€屽彉鍖栨椂錛岃絳栫暐鍙互閫氳繃浣跨敤鎶借薄宸ュ巶妯″紡瀹炵幇銆傛娊璞″伐鍘傚彲浠ュ熀浜庡伐鍘傛柟娉曞疄鐜拌€屽垱寤猴紝騫跺彲浣跨敤宸ュ巶鏂規硶瀹炵幇銆傝絳栫暐鎻愪緵涓€涓?SPAN lang=EN-US>DAO鐨勬娊璞″伐鍘傚璞★紝鍏朵腑璇ュ璞″彲浠ユ瀯閫犲縐嶇被鍨嬬殑鍏蜂綋鐨凞AO宸ュ巶錛屾瘡涓伐鍘傛敮鎸佷竴縐嶄笉鍚岀被鍨嬬殑鎸佷箙鎬у瓨鍌ㄥ疄鐜般€備竴鏃︿綘鑾峰彇鏌愮壒瀹氬疄鐜扮殑鍏蜂綋DAO宸ュ巶錛屽彲浠ヤ嬌鐢ㄥ畠鏉ョ敓鎴愯瀹炵幇涓墍鏀寔鍜屽疄鐜扮殑DAO銆?O:P>

2.4 榪炴帴姹犮€佸簲鐢ㄧ駭緙撳瓨鍙婁韓鍏冩ā寮忥紙鎻愬崌緋葷粺鎬ц兘錛?/SPAN>

緙撳瓨錛圕ache錛?O:P>

瀵逛簬鏁版嵁搴撴潵璇達紝鍘傚晢鐨勫仛娉曞線寰€鏄湪鍐呭瓨涓紑杈熺浉搴旂殑鍖哄煙鏉ュ瓨鍌ㄥ彲鑳借澶氭瀛樺彇鐨?鏁版嵁鍜屽彲鑳借澶氭鎵ц鐨勮鍙ワ紝浠ヤ嬌榪欎簺鏁版嵁鍦ㄤ笅嬈¤璁塊棶鏃朵笉蹇呭啀嬈℃彁浜ゅDBMS鐨勮姹傚拰閭d簺璇彞鍦ㄤ笅嬈℃墽琛屾椂涓嶅繀鍐嶆緙栬瘧銆?O:P>

鍚屾牱錛屾暟鎹寔涔呭眰閲囩敤緙撳瓨鎶€鏈潵淇濆瓨宸茬粡浠庢暟鎹簱涓绱㈠嚭鏉ョ殑閮ㄥ垎甯哥敤鏁版嵁銆傚鎴風璁塊棶鎸佷箙灞傛椂錛屾寔涔呭眰灝嗛鍏堣闂紦瀛橈紝濡傛灉鑳藉鍛戒腑鍒欑洿鎺ヤ粠緙撳瓨涓彁鍙栨暟鎹紝鍚﹀垯鍐嶅悜鏁版嵁搴撳彂閫佹彁鍙栨暟鎹殑鎸囦護銆傝繖縐嶈璁¤兘澶熷ぇ騫呭害鍦版彁楂樻暟鎹闂€熷害銆?SPAN lang=EN-US>

榪炴帴姹狅紙Connection Pool錛?O:P>

姹犳槸涓€涓緢鏅亶鐨勬蹇碉紝鍜岀紦鍐插瓨鍌ㄦ湁鏈哄埗鐩歌繎鐨勫湴鏂癸紝閮芥槸緙╁噺浜嗚闂殑鐜妭錛屼絾瀹冩洿娉ㄩ噸浜庤祫婧愮殑鍏變韓銆?SPAN lang=EN-US>

瀵逛簬璁塊棶鏁版嵁搴撴潵璇達紝寤虹珛榪炴帴鐨勪唬浠鋒瘮杈冩槀璐碉紝鍥犳錛屾暟鎹寔涔呭眰寤虹珛浜嗏€滆繛鎺ユ睜鈥濅互鎻愰珮璁塊棶鐨勬€ц兘銆傛暟鎹寔涔呭眰鎶婅繛鎺ュ綋浣滃璞★紝鏁翠釜緋葷粺鍚姩鍚庯紝榪炴帴姹犻鍏堝緩绔嬭嫢騫茶繛鎺ワ紝璁塊棶鏈潵闇€瑕佷笌鏁版嵁搴撹繛鎺ョ殑鍖哄煙錛岄兘鏀逛負鍜屾睜鐩歌繛錛屾睜涓存椂鍒嗛厤榪炴帴渚涜闂嬌鐢紝緇撴灉榪斿洖鍚庯紝璁塊棶灝嗚繛鎺ヤ氦榪樸€傝繖縐嶈璁℃秷闄や簡JDBC涓庢暟鎹簮寤虹珛榪炴帴鐨勫歡鏃訛紝鍚屾椂鍦ㄥ簲鐢ㄧ駭鎻愪緵浜嗗鏁版嵁婧愮殑騫跺彂璁塊棶銆?/SPAN>

浜厓妯″紡錛團lyweight錛?O:P>

闈㈠悜瀵硅薄璇█鐨勫師鍒欏氨鏄竴鍒囬兘鏄璞★紝浣嗘槸濡傛灉鐪熸浣跨敤璧鋒潵錛屾湁鏃跺璞℃暟鍙兘鏄懼緱寰堝簽澶э紝姣斿錛屾暟鎹簱涓殑璁板綍錛屽鏋滀互姣忔潯璁板綍浣滀負涓€涓璞★紝鎻愬彇鍑犲崈鏉¤褰曪紝瀵硅薄鏁板氨鏄嚑鍗冿紝榪欐棤鐤戠浉褰撹€楄垂鍐呭瓨銆傛暟鎹寔涔呭眰渚濇嵁浜厓妯″紡璁捐浜嗚嫢騫插厓綾伙紝灝佽鍙互琚叡浜殑綾匯€傝繖縐嶈璁$瓥鐣ユ樉钁楅檷浣庝簡緋葷粺鐨勫唴瀛樻秷鑰椼€?SPAN lang=EN-US>

2.5 鍚勭瀵硅薄鐨勫垱寤烘ā寮?/SPAN>鈥?/SPAN>宸ュ巶鏂規硶錛?SPAN lang=EN-US>Factory Method錛?/SPAN>

宸ュ巶鏂規硶妯″紡灝嗗垱寤哄疄渚嬬殑宸ヤ綔涓庝嬌鐢ㄥ疄渚嬬殑宸ヤ綔鍒嗗紑錛屼篃灝辨槸璇達紝璁╁垱寤哄疄渚嬫墍闇€瑕佺殑澶ч噺鍒濆鍖栧伐浣滀粠綆€鍗曠殑鏋勯€犲嚱鏁頒腑鍒嗙鍑哄幓銆傚彧闇€瑕佽皟鐢ㄤ竴涓粺涓€鐨勬柟娉曪紝鍗沖彲鏍規嵁闇€瑕佸垱寤哄嚭鍚勭瀵硅薄鐨勫疄渚嬶紝瀵硅薄鐨勫垱寤烘柟娉曚笉鍐嶇敤緙栫爜鍒扮▼搴忔ā鍧椾腑錛岃€屾槸緇熶竴緙栧啓鍦ㄥ伐鍘傜被涓€傝繖鏍峰湪緋葷粺榪涜鎵╁厖淇敼鏃訛紝緋葷粺鐨勫彉鍖栦粎瀛樺湪浜庡伐鍘傜被鍐呴儴錛岃€岀粷瀵逛笉浼氬鍏朵粬瀵硅薄閫犳垚褰卞搷銆?/SPAN>

錛堟敹紼挎棩鏈燂細2004-12-31  Email錛?A href="mailto:chl@tsxd.sina.net">chl@tsxd.sina.net錛?/FONT>  



]]>
主站蜘蛛池模板: 正蓝旗| 达尔| 慈溪市| 苏尼特左旗| 河间市| 晋中市| 汝南县| 城固县| 宁乡县| 鹤岗市| 华安县| 慈利县| 平果县| 绥阳县| 麟游县| 阿合奇县| 古丈县| 黔江区| 团风县| 监利县| 四平市| 文安县| 昌吉市| 乐业县| 池州市| 买车| 蓝山县| 鹤岗市| 水城县| 和龙市| 绵竹市| 伊春市| 平武县| 五家渠市| 淳安县| 云安县| 壤塘县| 屯门区| 陵水| 梅河口市| 安溪县|