﻿<?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-winneryong-随笔分类-Core Java </title><link>http://www.blogjava.net/winneryong/category/3434.html</link><description>梦魇</description><language>zh-cn</language><lastBuildDate>Fri, 09 Mar 2007 03:03:16 GMT</lastBuildDate><pubDate>Fri, 09 Mar 2007 03:03:16 GMT</pubDate><ttl>60</ttl><item><title>test code highlight</title><link>http://www.blogjava.net/winneryong/archive/2006/07/26/df.html</link><dc:creator>爱生活爱JAVA</dc:creator><author>爱生活爱JAVA</author><pubDate>Wed, 26 Jul 2006 02:52:00 GMT</pubDate><guid>http://www.blogjava.net/winneryong/archive/2006/07/26/df.html</guid><wfw:comment>http://www.blogjava.net/winneryong/comments/60128.html</wfw:comment><comments>http://www.blogjava.net/winneryong/archive/2006/07/26/df.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/winneryong/comments/commentRss/60128.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/winneryong/services/trackbacks/60128.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 id="Code_Closed_Image_105134" onclick="this.style.display='none'; Code_Closed_Text_105134.style.display='none'; Code_Open_Image_105134.style.display='inline'; Code_Open_Text_105134.style.display='inline';" height="16" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" />
				<img id="Code_Open_Image_105134" style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_105134.style.display='none'; Code_Closed_Image_105134.style.display='inline'; Code_Closed_Text_105134.style.display='inline';" height="16" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" />
				<span id="Code_Closed_Text_105134" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">hello</span>
				<span id="Code_Open_Text_105134" style="DISPLAY: none">
						<br />
						<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
						<span style="COLOR: #008080"> 1</span>
						<img id="Codehighlighter1_59_652_Open_Image" onclick="this.style.display='none'; Codehighlighter1_59_652_Open_Text.style.display='none'; Codehighlighter1_59_652_Closed_Image.style.display='inline'; Codehighlighter1_59_652_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" />
						<img id="Codehighlighter1_59_652_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_59_652_Closed_Text.style.display='none'; Codehighlighter1_59_652_Open_Image.style.display='inline'; Codehighlighter1_59_652_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />
						<span style="COLOR: #0000ff">private</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">static</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">void</span>
						<span style="COLOR: #000000"> showAllDatas(EntityManagerFactory emf) </span>
						<span id="Codehighlighter1_59_652_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
						<span id="Codehighlighter1_59_652_Open_Text">
								<span style="COLOR: #000000">{<br /></span>
								<span style="COLOR: #008080"> 2</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        EntityManager em </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> emf.createEntityManager();<br /></span>
								<span style="COLOR: #008080"> 3</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        em.getTransaction().begin();<br /></span>
								<span style="COLOR: #008080"> 4</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        List</span>
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000">Teacher</span>
								<span style="COLOR: #000000">&gt;</span>
								<span style="COLOR: #000000"> allTeachers </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> em.createQuery(<br /></span>
								<span style="COLOR: #008080"> 5</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">select teacher from Teacher teacher</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">).getResultList();<br /></span>
								<span style="COLOR: #008080"> 6</span>
								<span style="COLOR: #000000">
										<img id="Codehighlighter1_329_588_Open_Image" onclick="this.style.display='none'; Codehighlighter1_329_588_Open_Text.style.display='none'; Codehighlighter1_329_588_Closed_Image.style.display='inline'; Codehighlighter1_329_588_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />
										<img id="Codehighlighter1_329_588_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_329_588_Closed_Text.style.display='none'; Codehighlighter1_329_588_Open_Image.style.display='inline'; Codehighlighter1_329_588_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span>
								<span style="COLOR: #0000ff">for</span>
								<span style="COLOR: #000000"> (</span>
								<span style="COLOR: #0000ff">int</span>
								<span style="COLOR: #000000"> i </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #000000">0</span>
								<span style="COLOR: #000000">; i </span>
								<span style="COLOR: #000000">&lt;</span>
								<span style="COLOR: #000000"> allTeachers.size(); i</span>
								<span style="COLOR: #000000">++</span>
								<span style="COLOR: #000000">) </span>
								<span id="Codehighlighter1_329_588_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
										<img src="http://www.blogjava.net/images/dot.gif" />
								</span>
								<span id="Codehighlighter1_329_588_Open_Text">
										<span style="COLOR: #000000">{<br /></span>
										<span style="COLOR: #008080"> 7</span>
										<span style="COLOR: #000000">
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            Teacher teacher </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> allTeachers.get(i);<br /></span>
										<span style="COLOR: #008080"> 8</span>
										<span style="COLOR: #000000">
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />            System.out.println(teacher);<br /></span>
										<span style="COLOR: #008080"> 9</span>
										<span style="COLOR: #000000">
												<img id="Codehighlighter1_489_578_Open_Image" onclick="this.style.display='none'; Codehighlighter1_489_578_Open_Text.style.display='none'; Codehighlighter1_489_578_Closed_Image.style.display='inline'; Codehighlighter1_489_578_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />
												<img id="Codehighlighter1_489_578_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_489_578_Closed_Text.style.display='none'; Codehighlighter1_489_578_Open_Image.style.display='inline'; Codehighlighter1_489_578_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span>
										<span style="COLOR: #0000ff">for</span>
										<span style="COLOR: #000000"> (</span>
										<span style="COLOR: #0000ff">int</span>
										<span style="COLOR: #000000"> j </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> </span>
										<span style="COLOR: #000000">0</span>
										<span style="COLOR: #000000">; j </span>
										<span style="COLOR: #000000">&lt;</span>
										<span style="COLOR: #000000"> teacher.getStudents().size(); j</span>
										<span style="COLOR: #000000">++</span>
										<span style="COLOR: #000000">) </span>
										<span id="Codehighlighter1_489_578_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
												<img src="http://www.blogjava.net/images/dot.gif" />
										</span>
										<span id="Codehighlighter1_489_578_Open_Text">
												<span style="COLOR: #000000">{<br /></span>
												<span style="COLOR: #008080">10</span>
												<span style="COLOR: #000000">
														<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                System.out.println(</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"> teacher.getStudents().get(j));<br /></span>
												<span style="COLOR: #008080">11</span>
												<span style="COLOR: #000000">
														<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span>
										</span>
										<span style="COLOR: #000000">
												<br />
										</span>
										<span style="COLOR: #008080">12</span>
										<span style="COLOR: #000000">
												<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
								</span>
								<span style="COLOR: #008080">13</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        em.getTransaction().commit();<br /></span>
								<span style="COLOR: #008080">14</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        em.close();<br /></span>
								<span style="COLOR: #008080">15</span>
								<span style="COLOR: #000000">
										<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span>
						</span>
				</span>
		</div>
<img src ="http://www.blogjava.net/winneryong/aggbug/60128.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/winneryong/" target="_blank">爱生活爱JAVA</a> 2006-07-26 10:52 <a href="http://www.blogjava.net/winneryong/archive/2006/07/26/df.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>