锘??xml version="1.0" encoding="utf-8" standalone="yes"?>成人免费视频网站,国产精品亚洲片夜色在线,欧美日韩中字http://www.aygfsteel.com/lippea/category/1224.htmlIf u can look into my eyes, u will see how beautiful the life is.zh-cnFri, 02 Mar 2007 03:04:31 GMTFri, 02 Mar 2007 03:04:31 GMT60浣跨敤hibernate榪涜鎵歸噺鏇存柊鍜屽垹闄ゆ搷浣?/title><link>http://www.aygfsteel.com/lippea/articles/5276.html</link><dc:creator>lippea'blog</dc:creator><author>lippea'blog</author><pubDate>Fri, 27 May 2005 09:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/lippea/articles/5276.html</guid><wfw:comment>http://www.aygfsteel.com/lippea/comments/5276.html</wfw:comment><comments>http://www.aygfsteel.com/lippea/articles/5276.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/lippea/comments/commentRss/5276.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/lippea/services/trackbacks/5276.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; mso-char-indent-count: 2.57; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鏈枃涓殑鍔熻兘浠呭瓨鍦ㄤ簬</SPAN><SPAN lang=EN-US>hibernate3</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">涓€傚弬鑰冩枃浠?/SPAN><SPAN lang=EN-US>hibernate3</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">婧愪唬鐮佷腑鐨?/SPAN><SPAN lang=EN-US>org.hibernate.test.hql</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鍖呬笅鐨?/SPAN><SPAN lang=EN-US>BulkManipulationTest.java</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">銆?/SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; mso-char-indent-count: 2.57; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鍦?/SPAN><SPAN lang=EN-US>hibernate2</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">涓浜庢壒閲忔搷浣滅殑澶勭悊鏂規硶鏄紝鏌ヨ寰楀埌鎵€鏈夌鍚堟潯浠剁殑鏁版嵁搴撴暟鎹殑涓婚敭錛岀劧鍚庡鏍規嵁涓婚敭瀵規瘡鏉℃暟鎹繘琛屾搷浣溿€傝繖鏍鋒劅瑙夋棦璐規椂鍙堣垂鍔涖€傛渶鏂?/SPAN><SPAN lang=EN-US>Hibernate3</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">涓彁渚涙壒閲忔洿鏂版搷浣滃姛鑳姐€備緥濡傦細<BR></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">String hqlUpdate </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> 鈥?nbsp;UPDATE user u 鈥?/SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>鈥?nbsp;SET u.username</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">:newUsername, u.password</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">:newPassword 鈥?/SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>鈥?nbsp;WHERE u.username</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">:username and u.password</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">:password 鈥?<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>Query query </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> session.createQuery(hqlUpdate);<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>query.setString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">username</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,鈥漢fm鈥?;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>query.setString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">password</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,鈥?/SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">鈥?;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>query.setString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">newUsername</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,鈥漰s鈥?;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>query.setString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">newPassword</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,鈥?/SPAN><SPAN style="COLOR: #000000">123</SPAN><SPAN style="COLOR: #000000">鈥?;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff"><FONT color=#808080>int</FONT></SPAN><SPAN style="COLOR: #000000"><FONT color=#808080> </FONT>num </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> query.executeUpate();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>ts.commit();</SPAN></DIV></DIV></SPAN><BR> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">String hqlDelete </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> 鈥?nbsp;DELETE FROM user u 鈥?/SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>鈥?nbsp;WHERE u.username</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">:username and u.password</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">:password 鈥?<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>query.setString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">username</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,鈥漰s鈥?;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>query.setString(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">password</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,鈥?/SPAN><SPAN style="COLOR: #000000">123</SPAN><SPAN style="COLOR: #000000">鈥?;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff"><FONT color=#000000>int</FONT></SPAN><SPAN style="COLOR: #000000"><FONT color=#000000> num</FONT> </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> query.executeUpate();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>ts.commit();</SPAN></DIV></DIV><BR> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; mso-char-indent-count: 2.57; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鍙橀噺</SPAN><SPAN lang=EN-US>session</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鐨勭被鍨嬩負</SPAN><SPAN lang=EN-US>org.hibernate.Session;ts</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鐨勭被琛屼負涓?/SPAN><SPAN lang=EN-US>org.hibernate.Transaction;</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">榪斿洖鍊?/SPAN><SPAN lang=EN-US>num</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">琛ㄧず鏈夊嚑鏉℃暟鎹鎿嶄綔浜嗐€備互涓婁袱孌典唬鐮佹墽琛屽悗鍦ㄦ帶鍒跺彴涓墦鍑烘潵鐨?/SPAN><SPAN lang=EN-US>SQL</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鍒嗗埆鏄細</SPAN></P> <P class=MsoBodyText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="BACKGROUND: white; mso-highlight: white"><FONT face=瀹嬩綋 size=2>Hibernate: update CUSTOMER user0_ set user0_.USERNAME=?, user0_.PASSWORD=? where (user0_.USERNAME=? and user0_.PASSWORD=?)</FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 10pt; BACKGROUND: white; FONT-FAMILY: 瀹嬩綋; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-highlight: white">Hibernate: delete from CUSTOMER user0_ where (user0_.USERNAME=? and user0_.PASSWORD=?)</SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; mso-char-indent-count: 2.57; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">浠ヤ笂鏄垜璁や負姣旇緝濂界殑鏂規硶銆備絾鏄敞鎰忥紝浜х敓鐨勭浜屾潯璇彞涓嶈兘鍦?/SPAN><SPAN lang=EN-US>MySql</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">涓墽琛岋紝浣嗘槸</SPAN><SPAN lang=EN-US>hql</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">浠嶇劧鍙互琚紪璇戞垚</SPAN><SPAN lang=EN-US>sql</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">錛屼笉鐭ラ亾鏄垜璇硶鍐欓敊浜嗚繕鏄?/SPAN><SPAN lang=EN-US>bug</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">錛熸湁璋佷簡瑙e彲浠ョ粰鎴?/SPAN><SPAN lang=EN-US>mail</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">錛?/SPAN><SPAN lang=EN-US>lippea@sohu.com</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">銆傚彟澶栧湪鍙傝€冩枃浠?/SPAN><SPAN lang=EN-US>BulkManipulationTest.java</SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">涓湁涓€涓柟娉曪細</SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>public QueryTranslatorImpl assertTranslation(String hql) throws QueryException, MappingException;</SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; mso-char-indent-count: 2.57; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">榪欎釜鏂規硶鎴戜笉鐭ラ亾鏄共鍢涚殑錛屼絾鏄垜灝濊瘯浜嗘寜鐓ц繖縐嶅艦寮忚繘琛屾壒閲忔搷浣滐細<BR></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 100.84%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 247px"> <DIV><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">String hqlDelete </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> 鈥?nbsp;DELETE FROM user u 鈥?/SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>鈥?nbsp;WHERE u.username</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">:username and u.password</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">:password 鈥?<BR> Object[] objects </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff"><FONT color=#000000>new</FONT></SPAN><SPAN style="COLOR: #000000"> Object[]</SPAN><SPAN id=Codehighlighter1_131_141_Open_Text><SPAN style="COLOR: #000000">{鈥渉fm鈥?鈥?/SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">鈥潁 </SPAN></SPAN><SPAN style="COLOR: #000000"><BR> Type[] types</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #0000ff"><FONT color=#000000>new</FONT> </SPAN><SPAN style="COLOR: #000000">Type[]</SPAN><SPAN id=Codehighlighter1_168_215_Open_Text><SPAN style="COLOR: #000000">{(Type)Hibernate.STRING,(Type)Hibernate.STRING}</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>QueryParameters queryParas </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff"><FONT color=#000000>new</FONT></SPAN><SPAN style="COLOR: #000000"> QueryParameters(types,objects);<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>QueryTranslatorFactory ast </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff"><FONT color=#000000>new</FONT></SPAN><SPAN style="COLOR: #000000"> ASTQueryTranslatorFactory();<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>QueryTranslator newQueryTranslator </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> <BR>     ast.createQueryTranslator(hqlDelete, Collections.EMPTY_MAP,<BR>     (SessionFactoryImplementor)sf );<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>newQueryTranslator.compile( Collections.EMPTY_MAP, </SPAN><SPAN style="COLOR: #0000ff"><FONT color=#000000>false</FONT></SPAN><SPAN style="COLOR: #000000"> );<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff"><FONT color=#000000>int</FONT></SPAN><SPAN style="COLOR: #000000"> num </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> newQueryTranslator.executeUpdate(queryParas,<BR>               (SessionImplementor)session);</SPAN></DIV></DIV> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; mso-char-indent-count: 2.57; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US><FONT face="Times New Roman">sf</FONT></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鐨勭被鍨嬩負</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">org.hibernate.SessionFactory</FONT></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">錛?/SPAN><SPAN lang=EN-US><FONT face="Times New Roman">session</FONT></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鐨勭被鍨嬩負</SPAN><SPAN lang=EN-US><FONT face="Times New Roman">org.hibernate.Session</FONT></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">銆備嬌鐢ㄨ繖縐嶆柟娉曠殑緇撴灉涓庝笂闈㈤偅縐嶆柟娉曠殑緇撴灉鐩稿悓錛屼絾鏄湪瀵?/SPAN><SPAN lang=EN-US><FONT face="Times New Roman">hql</FONT></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">涓彉閲忚繘琛岃祴鍊煎緢涓嶆柟渚匡紝鎴戜篃娌″彂鐜拌繖縐嶆柟娉曟湁浠€涔堟洿騫挎硾鐨勭敤澶勩€傛垨璁告湁鍒殑鏂規硶璧嬪€鹼紝鎴栬€呭叾瀹冪敤澶勶紵</SPAN></P></SPAN><img src ="http://www.aygfsteel.com/lippea/aggbug/5276.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/lippea/" target="_blank">lippea'blog</a> 2005-05-27 17:36 <a href="http://www.aygfsteel.com/lippea/articles/5276.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>HibernateSynchronizer鐨勫畨瑁呬笌浣跨敤http://www.aygfsteel.com/lippea/articles/3971.htmllippea'bloglippea'blogSat, 30 Apr 2005 08:12:00 GMThttp://www.aygfsteel.com/lippea/articles/3971.htmlhttp://www.aygfsteel.com/lippea/comments/3971.htmlhttp://www.aygfsteel.com/lippea/articles/3971.html#Feedback1http://www.aygfsteel.com/lippea/comments/commentRss/3971.htmlhttp://www.aygfsteel.com/lippea/services/trackbacks/3971.htmlHibernateSynchronizer鐨勪綔鐢ㄦ槸鑷姩鐢熸垚hibernate閰嶇疆鏂囦歡錛屽嵆hibernate.cfg.xml鏂囦歡錛屾槧灝勬枃浠訛紝Plain Object綾繪枃浠跺拰涓€浜涘熀紜€鏁版嵁搴撴搷浣滄枃浠躲€??xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

瀹夎HibernateSynchronize

浠?/SPAN>http://www.binamics.com/hibernatesynch/plugins/com.hudson.hibernatesynchronizer_2.3.1.jar涓婁笅杞?/SPAN>com.hudson.hibernatesynchronizer_2.3.1.rar錛岃В鍘嬬緝鍚庢妸com.hudson.hibernatesynchronizer_2.3.1鏂囦歡澶規嫹璐濆埌eclipse鐨?/SPAN>plugins鐩綍涓嬨€傛敞鎰忔枃浠跺す涓嬪氨鍖呭惈plugin.xml絳夋枃浠訛紝涓嶈涓嬮潰榪樹繚鐣欐湁涓€灞傛枃浠跺す銆?/SPAN>

鍙︿竴縐嶆柟娉曟槸閫氳繃eclipse鑷姩瀹夎銆傜偣鍑?/SPAN>eclipse鑿滃崟鏍忎腑鐨勨€滃府鍔┾€?/SPAN>-銆夆€滆蔣浠舵洿鏂扳€?/SPAN>-銆夆€滄煡鎵懼茍瀹夎鈥?/SPAN>鈥濄€傚湪鎵撳紑鐨勬彁紺烘涓€夋嫨鈥滄悳绱㈣瀹夎鐨勬柊鍔熻兘閮ㄤ歡鈥濓紝鐒跺悗鐐瑰嚮鈥滀笅涓€姝モ€濓紝鐐瑰嚮鈥滄柊寤鴻繙紼嬬珯鐐?/SPAN>鈥?/SPAN>鈥濄€傚湪鍑虹幇鐨勬彁紺烘涓~鍏ヤ綘鑷繁鎯寵鏄劇ず鐨勨€滃悕縐扳€濓紝濡?/SPAN>HibernateSynchronize錛屽湪鈥?/SPAN>URL鈥濇爮涓~鍏?/SPAN>http://www.binamics.com/hibernatesync鐒跺悗涓€鐩寸偣鍑諱笅涓€姝ワ紝eclipse鍙互鑷繁瀹屾垚瀹夎銆?/SPAN>

鏃犺鍝鏂規硶錛屽畨瑁呭畬鍚庨噸璧?/SPAN>eclipse銆?/SPAN>

浣跨敤HibernateSynchronize

棣栧厛鐢熸垚hibernate鐨勯厤緗枃浠躲€傚彸鍑婚」鐩唴鐨勪換浣曟枃浠舵垨鑰呮枃浠跺す錛岀偣鍑燴€滄柊寤衡€濋€夐」涓殑鈥滃叾浠?/SPAN>鈥?/SPAN>鈥濄€傚湪鍑虹幇鐨勬彁紺烘涓笌CVS錛?/SPAN>JAVA涓€綰у簲璇ュ鍑轟竴涓?/SPAN>Hibernate鏂囦歡澶廣€傚鏋滄病鏈夌殑璇濓紝闇€瑕佽繑鍥炲畨瑁呮楠わ紝鏌ョ湅鏄惁鏈変粈涔堥棶棰橈紝鎴栬€呭啀灝濊瘯瀹夎涓€閬嶃€?/SPAN>

閫夋嫨鍏朵腑鐨勨€?/SPAN>Hibernate Configuration File鈥濓紝鐐瑰嚮鈥滀笅涓€姝モ€濄€傝繖鏄嚭鐜頒竴涓彁紺烘杈撳叆涓€浜涘熀鏈俊鎭€傗€?/SPAN>Container鈥濇槸閰嶇疆鏂囦歡鏀劇疆鐨勭洰褰曪紱鈥?/SPAN>File name鈥濇槸閰嶇疆鏂囦歡鐨勫悕縐幫紱鈥?/SPAN>Session Factory Name鈥濆彲浠ヤ笉濉紱鈥?/SPAN>Database Type鈥濅腑閫夋嫨浣犳墍鐢ㄧ殑鏁版嵁搴撶被鍨嬶紝鐢ㄤ簬閫夋嫨浣跨敤鐨?/SPAN>Dialect錛涒€?/SPAN>Application Server鈥濇槸搴旂敤紼嬪簭鏈嶅姟鍣ㄣ€傝繖涓€欏逛笉鏄緢鍏紝涓嶈繃涓嶉噸鏂伴€夋嫨涔熸病鏈夊叧緋匯€備富瑕侀渶瑕佸~鍐欑殑淇℃伅鏄笅闈⑩€?/SPAN>Connection鈥濈殑鈥?/SPAN>Local鈥濇爣絳句腑鐨勫唴瀹廣€?/SPAN>

鈥?/SPAN>Driver Class鈥濓細鐐瑰嚮鈥?/SPAN>Browe鈥濇寜閽紝鍦ㄩ€夋嫨鏉$洰涓緭鍏ヤ綘鐨勬暟鎹簱椹卞姩紼嬪簭鐨勭被鍚嶏紝濡?/SPAN>mysql鐨?/SPAN>Driver錛屽湪鍖歸厤鐨勭被鍨嬩腑閫夋嫨璇ユ紜殑綾誨悕錛岀劧鍚庡湪闄愬畾絎︿腑閫夋嫨椹卞姩紼嬪簭綾繪墍鍦ㄧ殑鍖咃紝濡?/SPAN>com.mysql.jdbc銆傜偣鍑燴€滅‘瀹氣€濆悗鍗沖湪Driver Class涓樉紺洪┍鍔ㄧ被鐨勫畬鏁村悕縐幫細com.mysql.jdbc.Driver銆傚鏋滄病鏈夋壘鍒伴┍鍔ㄧ被錛岄渶瑕佺‘瀹氫綘鏄惁鍦ㄩ」鐩腑寮曞叆浜嗛┍鍔ㄥ寘銆?/SPAN>

鈥?/SPAN>Database URL鈥濓細杈撳叆鏁版嵁搴撶殑鍦板潃銆傚錛?/SPAN>jdbc:mysql://localhost/hibernate_test錛屾渶鍚庢槸鏁版嵁搴撶殑鍚嶇О銆?/SPAN>

鈥?/SPAN>Username鈥濓細鏁版嵁搴撹闂殑鐢ㄦ埛鍚嶏紝mysql榛樿鐢ㄦ埛涓?/SPAN>root銆?/SPAN>

鈥?/SPAN>Password鈥濓細鏁版嵁搴撹闂殑瀵嗙爜銆?/SPAN>

鐐瑰嚮鈥滃畬鎴愨€濆嵆鐢熸垚閰嶇疆鏂囦歡銆?/SPAN>

 

鐒跺悗鏄敓鎴愭槧灝勬枃浠躲€傚悓鏍峰彸鍑婚」鐩唴鐨勪換浣曟枃浠舵垨鑰呮枃浠跺す錛岀偣鍑燴€滄柊寤衡€濋€夐」涓殑鈥滃叾浠?/SPAN>鈥?/SPAN>鈥濄€傞€夋嫨鈥?/SPAN>Hibernate Mapping File鈥濄€傚弬鑰冪敓鎴愰厤緗枃浠剁殑淇℃伅錛屽~濂?/SPAN>password鍙婂叾涓婇潰鐨勯」銆傜偣鍑燴€?/SPAN>refresh鈥滄寜閽紝鍑虹幇鎻愮ず妗嗛€夋嫨鏁版嵁搴撶殑椹卞姩紼嬪簭鍖呫€傜劧鍚庡湪Tables鏍忎腑浼氬垪鍑鴻搴撲腑鐨勬墍鏈夎〃銆傞€夋嫨瑕佺敓鎴愭槧灝勬枃浠剁殑琛紝騫跺湪鈥?/SPAN>Package鈥濅腑杈撳叆鎴栬€呰緭鍏ョ被鏂囦歡鎵€鍦ㄧ殑鍖咃紝娉ㄦ剰榪欓噷涓嶆槸鏄犲皠鏂囦歡鎵€鍦ㄧ殑鐩綍錛岃€屼笖涓嶈兘鏄┖鍖咃紝涔熷氨鏄牴鐩綍涓嬮潰銆傚悗闈㈠垱寤虹被鏂囦歡鏃跺氨浼氭牴鎹繖涓寘鑷姩灝嗙敓鎴愮殑鏂囦歡鏀懼叆鐩稿簲鐨勫寘涓€傜偣鍑燴€滃畬鎴愨€濄€?/SPAN>

鏄犲皠鏂囦歡涓嶄粎鍙互娣誨姞瀵瑰簲琛ㄧ殑鍒楋紝鑰屼笖鍙互鎸夌収hibenate瑙勫垯鍔犲叆琛ㄤ箣闂寸殑鍏崇郴銆傛柊澧炴槧灝勬枃浠朵箣鍚庯紝榪樹細鑷姩鏇存柊閰嶇疆鏂囦歡錛屽姞鍏ユ槧灝勬枃浠朵俊鎭€?/SPAN>

 

鐢熸垚綾繪枃浠跺強鍩烘湰鐨?/SPAN>DAO鏂囦歡銆傞€変腑闇€瑕佺敓鎴愮被鏂囦歡鐨勬槧灝勬枃浠訛紝鍗充笂涓€姝ョ敓鎴愮殑.hbm鏂囦歡錛屽彲浠ュ悓鏃墮€変腑澶氫釜鏄犲皠鏂囦歡銆傚彸鍑伙紝閫夋嫨鈥?/SPAN>Hibernate Synchronizer鈥濅腑鐨勨€?/SPAN>Synchronize File鈥濄€傝繖欏規搷浣滃悓鏃朵細鏇存柊鐢熸垚鐨勯厤緗枃浠訛紝鍦ㄥ叾涓坊鍔犳槧灝勬枃浠朵俊鎭€傚鏋滀綘淇敼浜嗘槧灝勬枃浠訛紝闇€瑕佹洿鏂扮被鏂囦歡鏃訛紝鍙沖嚮鏄犲皠鏂囦歡錛岄€夋嫨鈥?/SPAN>Hibernate Synchronizer鈥濅腑鐨勨€?/SPAN>Synchronize and Overwrite鈥濓紝鍒欒嚜鍔ㄦ洿鏂扮被鏂囦歡鐩稿叧鐨勫湴鏂廣€?/SPAN>

 

渚嬪瓙鐢ㄧ殑榪欎釜宸ュ叿鏄?/SPAN>2鐗堟湰鐨勶紝浣跨敤瀹冪敓鎴愮殑鏂囦歡錛屾棤璁烘槸鏂規硶榪樻槸寮曠敤鐨勫寘閮芥槸浣跨敤hibernate2.jar鐨勬爣鍑嗭紝姣斿net.sf鈥︹€︺€傛墍浠ュ鏋滆浣跨敤錛岄渶瑕佹妸鐩稿叧鐨勮礬寰勬敼榪囨潵銆傝礬寰勮繕濂藉鐞嗭紝姣旇緝澶寸柤鐨勬槸鐢熸垚鐨勪竴浜涗唬鐮佷腑寮曠敤鐨勬柟娉曞湪hibernate3.jar涓凡緇忓幓闄や簡錛岃繖鏍蜂綘蹇呴』鑷繁瀹炵幇閭i儴鍒嗗姛鑳姐€傝繕瑕佹敞鎰忛厤緗枃浠朵腑鐨勪竴浜涜緗紝涔熸湁鍙兘瀵艱嚧紼嬪簭榪愯涓嶄簡銆?/SPAN>



lippea'blog 2005-04-30 16:12 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 琼海市| 司法| 林周县| 武川县| 合肥市| 庄河市| 防城港市| 颍上县| 略阳县| 桓台县| 惠水县| 曲周县| 拜城县| 启东市| 隆子县| 古交市| 微山县| 兴文县| 措美县| 郁南县| 合阳县| 凤冈县| 南乐县| 民权县| 永康市| 正镶白旗| 舒兰市| 崇信县| 丰城市| 南皮县| 库车县| 黎川县| 略阳县| 铜鼓县| 阿瓦提县| 渝北区| 青海省| 嵊泗县| 龙州县| 定边县| 迭部县|