<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>~SingleForum~无废话记录~: Recent Topics</title>
<link>http://www.ll19.com/bb/</link>
<description>~19~记录点有用的好吗？少说废话少装b~</description>
<language>en</language>
<pubDate>Sat, 31 Jul 2010 18:09:02 +0000</pubDate>

<item>
<title>admin on "innodb和myisam"</title>
<link>http://www.ll19.com/bb/topic/123#post-123</link>
<pubDate>Tue, 12 Jan 2010 03:13:54 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">123@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;myisam属于非事务安全型，innodb和bdb属于事务安全型，在使用上，包括建立表，insert，select等等操作上有没有什么区别。但是myisam引擎速度比较快、比较简单、而InnoDB支持外键、其速度相对就慢了。&#60;/p&#62;
&#60;p&#62;  MyISAM类型的表强调的是性能，其执行数度比InnoDB类型更快，但是不提供事务支持，而InnoDB提供事务支持已经外部键等高级数据库功能。这 样就可以根据数据表不同的用处是用不同的存储类型。另外，MyISAM类型的二进制数据文件可以在不同操作系统中迁移。也就是可以直接从Windows系统拷贝到linux系统中使用。所以我一般都是使用myisam，因为这次用的也不是很深入的。&#60;/p&#62;
&#60;p&#62;  如果把这类型从MyISAM转成 InnoDB会不会有问题、但是全文索引失效.&#60;/p&#62;
&#60;p&#62;  使用两种的选择：如果你的数据执行大量的INSERT或UPDATE，出于性能方面的考虑，应该使用InnoDB表。如果执行大量的SELECT，MyISAM是更好的选择。若需要使用事务处理，但是原来的数据表使用的是myisam，就需要改为bdb或者innodb，这样基于myisam的程序，将类型改为innodb后，其程序不用改动……
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "MySQL 更改表的字符编码"</title>
<link>http://www.ll19.com/bb/topic/122#post-122</link>
<pubDate>Tue, 12 Jan 2010 02:41:06 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">122@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;MySQL 更改表的字符编码 &#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="lsql-1"><a href="#" onclick="javascript:showPlainTxt('sql-1'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">SQL:</span><br /><div id="sql-1">
<div class="sql"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;<span style="color: #808080; font-style: italic;">#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">TABLE</span>&nbsp; privilege<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> convert <span style="color: #993333; font-weight: bold;">TO</span> character <span style="color: #993333; font-weight: bold;">SET</span> utf8 collate utf8_general_ci<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&amp;<span style="color: #808080; font-style: italic;">#60;br /&amp;#62; </span></div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;(1)表示要改的表的字符编码 (2)表示要改成什么样的字符编码
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "js array的排序"</title>
<link>http://www.ll19.com/bb/topic/121#post-121</link>
<pubDate>Mon, 11 Jan 2010 03:51:51 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">121@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;简单的排序&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljavascript-2"><a href="#" onclick="javascript:showPlainTxt('javascript-2'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span><br /><div id="javascript-2">
<div class="javascript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">var</span> arrayValue=<span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;arrayValue<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #CC0000;color:#800000;">10</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;arrayValue<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #CC0000;color:#800000;">5</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;arrayValue<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">2</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #CC0000;color:#800000;">4</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;arrayValue.<span style="color: #006600;">sort</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>a,b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span> b-a;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066;">alert</span> <span style="color: #66cc66;">&#40;</span>arrayValue<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;数组的排序:sort()方法. 但sort()方法本身是按ASCII字符代码从小到大排列的.所以说,如果是数字的话,可能会有问题，但是: sort()方法可以接收一个比较函数的参数。&#60;/p&#62;
&#60;p&#62;下面的例子：&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljavascript-3"><a href="#" onclick="javascript:showPlainTxt('javascript-3'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span><br /><div id="javascript-3">
<div class="javascript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> compareint<span style="color: #66cc66;">&#40;</span>int1, int2<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> iNum1 = parseInt<span style="color: #66cc66;">&#40;</span>int1<span style="color: #66cc66;">&#41;</span>;<span style="color: #009900; font-style: italic;">//强制转换成int 型;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> iNum2 = parseInt<span style="color: #66cc66;">&#40;</span>int2<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>iNum1 &amp;#38;lt; iNum2<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> -<span style="color: #CC0000;color:#800000;">1</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>iNum1 &amp;#38;gt; iNum2<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;color:#800000;">1</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;color:#800000;">0</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> arr = <span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">3</span>, <span style="color: #CC0000;color:#800000;">32</span>, <span style="color: #CC0000;color:#800000;">2</span>, <span style="color: #CC0000;color:#800000;">5</span><span style="color: #66cc66;">&#93;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">arr.<span style="color: #006600;">sort</span><span style="color: #66cc66;">&#40;</span>compareint<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>arr.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #009900; font-style: italic;">//输出:2,3,5,32&amp;#60;br /&amp;#62; </span></div></li></ol></div>
</div></div><br />
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "关于onsubmit不执行 - -"</title>
<link>http://www.ll19.com/bb/topic/120#post-120</link>
<pubDate>Mon, 11 Jan 2010 03:49:31 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">120@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;button执行的函数中，执行document.forms[0].submit();是不执行onsubmit事件的。&#60;/p&#62;
&#60;p&#62;只有点击submit按钮的时候才执行&#60;br /&#62;
即form 中的onsubmit=&#34;return check();&#34;&#60;br /&#62;
或&#60;br /&#62;
document.test.onsubmit = function () {&#60;br /&#62;
		alert (3322);&#60;br /&#62;
		return false;&#60;br /&#62;
		};&#60;br /&#62;
之类~&#60;/p&#62;
&#60;p&#62;即使是在form中加入了  onsubmit=&#34;return check();&#34;&#60;br /&#62;
用button执行函数来document.forms[0].submit();&#60;br /&#62;
也不会执行onsubmit事件
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "获取浏览器可视方法"</title>
<link>http://www.ll19.com/bb/topic/119#post-119</link>
<pubDate>Mon, 11 Jan 2010 03:46:39 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">119@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;获取浏览器可视方法&#60;br /&#62;
var de=document.documentElement;&#60;br /&#62;
var db=document.body;&#60;br /&#62;
var viewW=de.clientWidth==0 ?  db.clientWidth : de.clientWidth;&#60;br /&#62;
var viewH=de.clientHeight==0 ?  db.clientHeight : de.clientHeight;&#60;br /&#62;
可以全屏显示FLASH用
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "jquery的Unbind"</title>
<link>http://www.ll19.com/bb/topic/118#post-118</link>
<pubDate>Mon, 11 Jan 2010 03:40:23 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">118@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;Unbind只是 用来解除bind上去的函数的&#60;/p&#62;
&#60;p&#62;所以如果你想这么去删的话 那就不要直接写onclick 而是 jQuery(document).ready(function(){&#60;br /&#62;
用bind去加
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "Spring调用存储过程一个小记录"</title>
<link>http://www.ll19.com/bb/topic/117#post-117</link>
<pubDate>Sun, 03 Jan 2010 16:38:05 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">117@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;Spring调用存储过程一个小记录&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljava-4"><a href="#" onclick="javascript:showPlainTxt('java-4'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-4">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> testSpringPackage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;SpringStoredProce springStoredProce = <span style="color: #000000; font-weight: bold;">new</span> SpringStoredProce<span style="color: #66cc66;">&#40;</span>this&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #006600;">getJdbcTemplate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; List&amp;#38;lt;Map&amp;#38;gt; resultList = springStoredProce.<span style="color: #006600;">execute</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">10</span>,&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;#34; and t.<span style="color: #006600;">seed_name_cn</span> like <span style="color: #ff0000;">'%竹%'</span> &amp;#34;<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color: #cc66cc;color:#800000;">0</span>; i &amp;#38;lt; resultList.<span style="color: #006600;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AMap+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Map</span></a> rowMap = resultList.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> userId = rowMap.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span>&amp;#34;seed_name_cn&amp;#34;<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> name = rowMap.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span>&amp;#34;g_name_cn&amp;#34;<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> password = rowMap.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tagsids&amp;#34;<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>&amp;#34;USER_ID=&amp;#34; + userId + &amp;#34;\t name=&amp;#34; + name&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + &amp;#34;\t password=&amp;#34; + password<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljava-5"><a href="#" onclick="javascript:showPlainTxt('java-5'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-5">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #a1a100;">import java.sql.CallableStatement;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import java.sql.Connection;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import java.sql.ResultSet;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import java.sql.SQLException;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import java.util.ArrayList;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import java.util.HashMap;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import java.util.List;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import java.util.Map;&amp;#60;/p&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #a1a100;">import org.springframework.dao.DataAccessException;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import org.springframework.jdbc.core.CallableStatementCallback;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import org.springframework.jdbc.core.CallableStatementCreator;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import org.springframework.jdbc.core.JdbcTemplate;&amp;#60;/p&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #a1a100;">import com.rizon.eiss.util.StringUtils;&amp;#60;/p&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;public <span style="color: #000000; font-weight: bold;">class</span> SpringStoredProce <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> JdbcTemplate jdbcTemplate;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> SpringStoredProce<span style="color: #66cc66;">&#40;</span>JdbcTemplate jdbcTemplate<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">jdbcTemplate</span> = jdbcTemplate;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> List&amp;#38;lt;Map&amp;#38;gt; execute<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">long</span> start_no, <span style="color: #993333;">long</span> end_no, <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> filter<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; List&amp;#38;lt;Map&amp;#38;gt; resultList = <span style="color: #000000; font-weight: bold;">null</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; resultList = <span style="color: #66cc66;">&#40;</span>List&amp;#38;lt;Map&amp;#38;gt;<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">jdbcTemplate</span>.<span style="color: #006600;">execute</span><span style="color: #66cc66;">&#40;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> ProcCallableStatementCreator<span style="color: #66cc66;">&#40;</span>start_no, end_no, filter<span style="color: #66cc66;">&#41;</span>,&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> ProcCallableStatementCallback<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span>DataAccessException e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ARuntimeException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">RuntimeException</span></a><span style="color: #66cc66;">&#40;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;#34;execute method error : DataAccessException &amp;#34;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + e.<span style="color: #006600;">getMessage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> resultList;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #808080; font-style: italic;">/**&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * Create a callable statement in this connection.&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">class</span> ProcCallableStatementCreator implements&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CallableStatementCreator <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">long</span> start_no;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">long</span> end_no;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> filter;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> ProcCallableStatementCreator<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">long</span> start_no, <span style="color: #993333;">long</span> end_no,&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> filter<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">start_no</span> = start_no;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">end_no</span> = end_no;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">filter</span> = filter;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3ACallableStatement+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">CallableStatement</span></a> createCallableStatement<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AConnection+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Connection</span></a> conn<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;<a href="http://www.google.com/search?q=allinurl%3ACallableStatement+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">CallableStatement</span></a> cs = <span style="color: #000000; font-weight: bold;">null</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs = conn.<span style="color: #006600;">prepareCall</span><span style="color: #66cc66;">&#40;</span>&amp;#34;<span style="color: #66cc66;">&#123;</span>call TREE_PACKAGE.<span style="color: #006600;">TREE_FIND</span><span style="color: #66cc66;">&#40;</span>?,?,?,?<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#125;</span>&amp;#34;<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs.<span style="color: #006600;">registerOutParameter</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span>, oracle.<span style="color: #006600;">jdbc</span>.<span style="color: #006600;">OracleTypes</span>.<span style="color: #006600;">CURSOR</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs.<span style="color: #006600;">setLong</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span>, start_no<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs.<span style="color: #006600;">setLong</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">3</span>, end_no<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs.<span style="color: #006600;">setString</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">4</span>, filter<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ASQLException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">SQLException</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ARuntimeException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">RuntimeException</span></a><span style="color: #66cc66;">&#40;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;#34;createCallableStatement method <a href="http://www.google.com/search?q=allinurl%3AError+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Error</span></a> : <a href="http://www.google.com/search?q=allinurl%3ASQLException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">SQLException</span></a> &amp;#34;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + e.<span style="color: #006600;">getMessage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> cs;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">class</span> ProcCallableStatementCallback implements&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CallableStatementCallback <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> ProcCallableStatementCallback<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AObject+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> doInCallableStatement<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ACallableStatement+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">CallableStatement</span></a> cs<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List&amp;#38;lt;Map&amp;#38;gt; resultsMap = <span style="color: #000000; font-weight: bold;">new</span> ArrayList&amp;#38;lt;Map&amp;#38;gt;<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs.<span style="color: #006600;">execute</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AResultSet+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">ResultSet</span></a> rs = <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AResultSet+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">ResultSet</span></a><span style="color: #66cc66;">&#41;</span> cs.<span style="color: #006600;">getObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">next</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Map&amp;#38;lt;String, Object&amp;#38;gt; rowMap = <span style="color: #000000; font-weight: bold;">new</span> HashMap&amp;#38;lt;String, Object&amp;#38;gt;<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;t_id&amp;#34;, rs.<span style="color: #006600;">getLong</span><span style="color: #66cc66;">&#40;</span>&amp;#34;t_id&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;status&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;status&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tree_name&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tree_name&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;seed_name_cn&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;seed_name_cn&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;seed_name_en&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;seed_name_en&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;seed_comment&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;seed_comment&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;gid&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;gid&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;g_name_cn&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;g_name_cn&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;g_name_en&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;g_name_en&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;g_class&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;g_class&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tagsname&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tagsname&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tagsids&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tagsids&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowMap.<span style="color: #006600;">put</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tags_des&amp;#34;, StringUtils.<span style="color: #006600;">Trim</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span>&amp;#34;tags_des&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resultsMap.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>rowMap<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rs.<span style="color: #006600;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ASQLException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">SQLException</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3ARuntimeException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">RuntimeException</span></a><span style="color: #66cc66;">&#40;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;#34;doInCallableStatement method error : <a href="http://www.google.com/search?q=allinurl%3ASQLException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">SQLException</span></a> &amp;#34;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + e.<span style="color: #006600;">getMessage</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> resultsMap;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "DWR返回LIST"</title>
<link>http://www.ll19.com/bb/topic/116#post-116</link>
<pubDate>Sun, 03 Jan 2010 16:32:16 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">116@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;DWR返回LIST&#60;/p&#62;
&#60;p&#62;list中如果装载的不是基本类型的数据，而是java bean的话，需要在dwr.xml中配置convert参数，才能在页面上将数据 转换成js对象。&#60;/p&#62;
&#60;p&#62;如果配置了这个参数的话，在页面上使用data.XXX来访问该对象中的属性。比如有个user对象里面有name属性，和getName方法，则只需要 使用data.name来取得该值。&#60;/p&#62;
&#60;p&#62;LIST中的BEAN其实就是转换成了JSON&#60;/p&#62;
&#60;p&#62;具体做法如下 （网络搜索的例子）&#60;/p&#62;
&#60;p&#62;dwr.xml里的代码如下：&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="lxml-6"><a href="#" onclick="javascript:showPlainTxt('xml-6'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">XML:</span><br /><div id="xml-6">
<div class="xml"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;dwr<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ddbb00;">&amp;#38;</span>lt;allow<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;create creator=<span style="color: #ddbb00;">&amp;#34;</span>new<span style="color: #ddbb00;">&amp;#34;</span> javascript=<span style="color: #ddbb00;">&amp;#34;</span>DwrTest<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ddbb00;">&amp;#38;</span>lt;param name=<span style="color: #ddbb00;">&amp;#34;</span>class<span style="color: #ddbb00;">&amp;#34;</span> value=<span style="color: #ddbb00;">&amp;#34;</span>com.Dao.DwrTest<span style="color: #ddbb00;">&amp;#34;</span>/<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ddbb00;">&amp;#38;</span>lt;/create<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ddbb00;">&amp;#38;</span>lt;convert match=<span style="color: #ddbb00;">&amp;#34;</span>com.Action.Admin<span style="color: #ddbb00;">&amp;#34;</span> converter=<span style="color: #ddbb00;">&amp;#34;</span>bean<span style="color: #ddbb00;">&amp;#34;</span> <span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ddbb00;">&amp;#38;</span>lt;param name=<span style="color: #ddbb00;">&amp;#34;</span>include<span style="color: #ddbb00;">&amp;#34;</span> value=<span style="color: #ddbb00;">&amp;#34;</span>id,admin_Name,admin_Pwd,mark_id<span style="color: #ddbb00;">&amp;#34;</span> /<span style="color: #ddbb00;">&amp;#38;</span>gt;&nbsp; &nbsp;// Admin的bean中包含这四个属性，bean文件内容我就不贴出来了，<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ddbb00;">&amp;#38;</span>lt;/convert<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ddbb00;">&amp;#38;</span>lt;/allow<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;/dwr<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span> </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;TestDao类的内容如下：&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljava-7"><a href="#" onclick="javascript:showPlainTxt('java-7'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-7">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestDao<span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">static</span> <a href="http://www.google.com/search?q=allinurl%3AConnection+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Connection</span></a> conn = Conn.<span style="color: #006600;">GetConn</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//获得数据库连接&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> List&amp;#38;lt;Admin&amp;#38;gt; Send<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> mark<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; List&amp;#38;lt;Admin&amp;#38;gt; list = <span style="color: #000000; font-weight: bold;">new</span> ArrayList&amp;#38;lt;Admin&amp;#38;gt;<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AStatement+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Statement</span></a> stat = conn.<span style="color: #006600;">createStatement</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> QueryStr = &amp;#34;select * from admin_info where mark_id=&amp;#34;+mark+&amp;#34;&amp;#34;;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AResultSet+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">ResultSet</span></a> rs = stat.<span style="color: #006600;">executeQuery</span><span style="color: #66cc66;">&#40;</span>QueryStr<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">next</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;Admin admin = <span style="color: #000000; font-weight: bold;">new</span> Admin<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;admin.<span style="color: #006600;">setId</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getInt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;admin.<span style="color: #006600;">setAdmin_Name</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;admin.<span style="color: #006600;">setAdmin_Pwd</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;admin.<span style="color: #006600;">setMark_id</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getInt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">4</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;list.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>admin<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ASQLException+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">SQLException</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> list;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;DwrTest类内容如下：&#60;/p&#62;
&#60;p&#62;[java]&#60;br /&#62;
public class DwrTest{&#60;br /&#62;
    TestDao dao= new TestDao();&#60;br /&#62;
    public List&#38;lt;Admin&#38;gt; Send(int mark) {&#60;br /&#62;
    return dao.Send(mark);&#60;br /&#62;
    }&#60;br /&#62;
}&#60;br /&#62;
[java]&#60;/p&#62;
&#60;p&#62;jsp文件内容如下：&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="lhtml-8"><a href="#" onclick="javascript:showPlainTxt('html-8'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">HTML:</span><br /><div id="html-8">
<div class="html"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;html<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;head<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;meta http-equiv=<span style="color: #ddbb00;">&amp;#34;</span>Content-Type<span style="color: #ddbb00;">&amp;#34;</span> content=<span style="color: #ddbb00;">&amp;#34;</span>text/html; charset=ISO-8859-1<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;TITLE<span style="color: #ddbb00;">&amp;#38;</span>gt;DWR返回list的一个简单例子<span style="color: #ddbb00;">&amp;#38;</span>lt;/TITLE<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;meta http-equiv=Content-Type content=<span style="color: #ddbb00;">&amp;#34;</span>text/html; charset=gb2312<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;script src=<span style="color: #ddbb00;">&amp;#34;</span>dwr/engine.js<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#38;</span>lt;/script<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;script src=<span style="color: #ddbb00;">&amp;#34;</span>dwr/util.js<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#38;</span>lt;/script<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;script src=<span style="color: #ddbb00;">&amp;#34;</span>dwr/interface/DwrTest.js<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#38;</span>lt;/script<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;SCRIPT LANGUAGE=<span style="color: #ddbb00;">&amp;#34;</span>JavaScript<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function CallBack(data) {<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;if (data.length == 0) {<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;alert(<span style="color: #ddbb00;">&amp;#34;</span>参数传递出现错误!<span style="color: #ddbb00;">&amp;#34;</span>);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;}else{<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; for(var i=0;i<span style="color: #ddbb00;">&amp;#38;</span>lt;data.length;i++){<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;addRow(data[i].admin_Name,data[i].admin_Pwd,data[i].mark_id);&nbsp; &nbsp;// 表格添加一行<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; }<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;}<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">}<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function Send(mark){<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;DwrTest.Send(mark,CallBack);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">}<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function showTable(mark){<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;var i=1;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;for(i=form1.maxrow.value; i<span style="color: #ddbb00;">&amp;#38;</span>gt;0 ; i--)<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;{<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;deleteRow(i);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;}<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;form1.maxrow.value = 0;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;Send(mark);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 通过mark参数来判断要动态显示的内容<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">}<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function deleteRow(index){<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;var tableObj=document.getElementById(<span style="color: #ddbb00;">&amp;#34;</span>mytable<span style="color: #ddbb00;">&amp;#34;</span>);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;tableObj.deleteRow(index);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">} <span style="color: #ddbb00;">&amp;#60;</span>/p<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#60;</span>p<span style="color: #ddbb00;">&amp;#62;</span>function addRow(username,password,mark_id){<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;var tableObj=document.getElementById(<span style="color: #ddbb00;">&amp;#34;</span>mytable<span style="color: #ddbb00;">&amp;#34;</span>);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;var newRowObj=tableObj.insertRow(tableObj.rows.length);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;var newColName=newRowObj.insertCell(newRowObj.cells.length);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;var newColPwd=newRowObj.insertCell(newRowObj.cells.length);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;var newColMrk=newRowObj.insertCell(newRowObj.cells.length);<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;newColName.innerHTML=username;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;newColPwd.innerHTML=password;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;newColMrk.innerHTML=mark_id;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; form1.maxrow.value = parseInt(form1.maxrow.value) + 1;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">}<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;/SCRIPT<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;BODY<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;form name=<span style="color: #ddbb00;">&amp;#34;</span>form1<span style="color: #ddbb00;">&amp;#34;</span> <span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;p align=<span style="color: #ddbb00;">&amp;#34;</span>center<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #ddbb00;">&amp;#38;</span>lt;input type=<span style="color: #ddbb00;">&amp;#34;</span>button<span style="color: #ddbb00;">&amp;#34;</span> value=<span style="color: #ddbb00;">&amp;#34;</span>用户类别一 <span style="color: #ddbb00;">&amp;#34;</span> onmouseover=<span style="color: #ddbb00;">&amp;#34;</span>showTable(1)<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt; // 传参数 mark=1<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #ddbb00;">&amp;#38;</span>lt;input type=<span style="color: #ddbb00;">&amp;#34;</span>button<span style="color: #ddbb00;">&amp;#34;</span> value=<span style="color: #ddbb00;">&amp;#34;</span>用户类别二<span style="color: #ddbb00;">&amp;#34;</span> onmouseover=<span style="color: #ddbb00;">&amp;#34;</span>showTable(2)<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #ddbb00;">&amp;#38;</span>lt;input type=<span style="color: #ddbb00;">&amp;#34;</span>button<span style="color: #ddbb00;">&amp;#34;</span> value=<span style="color: #ddbb00;">&amp;#34;</span>用户类别三<span style="color: #ddbb00;">&amp;#34;</span> onmouseover=<span style="color: #ddbb00;">&amp;#34;</span>showTable(3)<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #ddbb00;">&amp;#38;</span>lt;input type=<span style="color: #ddbb00;">&amp;#34;</span>button<span style="color: #ddbb00;">&amp;#34;</span> value=<span style="color: #ddbb00;">&amp;#34;</span>用户类别四<span style="color: #ddbb00;">&amp;#34;</span> onmouseover=<span style="color: #ddbb00;">&amp;#34;</span>showTable(4)<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;/p<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;table width=<span style="color: #ddbb00;">&amp;#34;</span>50%<span style="color: #ddbb00;">&amp;#34;</span> id=<span style="color: #ddbb00;">&amp;#34;</span>mytable<span style="color: #ddbb00;">&amp;#34;</span> border=<span style="color: #ddbb00;">&amp;#34;</span>1<span style="color: #ddbb00;">&amp;#34;</span> bordercolor=<span style="color: #ddbb00;">&amp;#34;</span>whitesmoke<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #ddbb00;">&amp;#38;</span>lt;tr align=<span style="color: #ddbb00;">&amp;#34;</span>center<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#38;</span>lt;td<span style="color: #ddbb00;">&amp;#38;</span>gt;用户名<span style="color: #ddbb00;">&amp;#38;</span>lt;/td<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#38;</span>lt;td<span style="color: #ddbb00;">&amp;#38;</span>gt;密码<span style="color: #ddbb00;">&amp;#38;</span>lt;/td<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#38;</span>lt;td类 别<span style="color: #ddbb00;">&amp;#38;</span>lt;/td<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#38;</span>lt;/tr<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;/table<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ddbb00;">&amp;#38;</span>lt;input type=<span style="color: #ddbb00;">&amp;#34;</span>hidden<span style="color: #ddbb00;">&amp;#34;</span> name=<span style="color: #ddbb00;">&amp;#34;</span>maxrow<span style="color: #ddbb00;">&amp;#34;</span> value=<span style="color: #ddbb00;">&amp;#34;</span>0<span style="color: #ddbb00;">&amp;#34;</span><span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;/form<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;/body<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ddbb00;">&amp;#38;</span>lt;/html<span style="color: #ddbb00;">&amp;#38;</span>gt;<span style="color: #ddbb00;">&amp;#60;</span>br /<span style="color: #ddbb00;">&amp;#62;</span> </div></li></ol></div>
</div></div><br />
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "DWR调用的java代码中使用Session,Request,Responsed"</title>
<link>http://www.ll19.com/bb/topic/115#post-115</link>
<pubDate>Sun, 03 Jan 2010 16:29:56 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">115@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;在Java的服务方法中定义这些类型的参数,让DWR自动传入相应的对象：&#60;/p&#62;
&#60;p&#62;HttpServletRequest,HttpServletResponse,HttpSession,ServletContext,ServletConfig.&#60;/p&#62;
&#60;p&#62;示例如下:&#60;/p&#62;
&#60;p&#62;Java端定义方法: saveOrder(String id, String name, HttpSession session)&#60;/p&#62;
&#60;p&#62;Javascript调用: OrderService.saveOrder(jsID,jsName,callBack)&#60;/p&#62;
&#60;p&#62;注意,这里不需要传入session这个参数,DWR会自动传入,在Java端可以直接使用.
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "DWR提交整个表单"</title>
<link>http://www.ll19.com/bb/topic/114#post-114</link>
<pubDate>Sun, 03 Jan 2010 16:28:28 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">114@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;<div class="igBar"><span id="ljavascript-9"><a href="#" onclick="javascript:showPlainTxt('javascript-9'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span><br /><div id="javascript-9">
<div class="javascript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> callBackFun<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #009900; font-style: italic;">// formMap是整个表单&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> formMap = DWRUtil.<span style="color: #006600;">getValues</span><span style="color: #66cc66;">&#40;</span>&amp;#34;aform&amp;#34;<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; dwrTree.<span style="color: #006600;">addTags</span><span style="color: #66cc66;">&#40;</span>formMap, result<span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #003366; font-weight: bold;">function</span> result<span style="color: #66cc66;">&#40;</span>data<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>data == &amp;#34;success&amp;#34;<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066;">alert</span> <span style="color: #66cc66;">&#40;</span>&amp;#34;添加成功！&amp;#34;<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #009900; font-style: italic;">//jQuery(&amp;#34;#ajax-response&amp;#34;).show().html(&amp;#34;添加成功！&amp;#34;).fadeOut(5000);&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;jQuery<span style="color: #66cc66;">&#40;</span>&amp;#34;#name&amp;#34;<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">val</span><span style="color: #66cc66;">&#40;</span>&amp;#34;&amp;#34;<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;jQuery<span style="color: #66cc66;">&#40;</span>&amp;#34;#slug&amp;#34;<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">val</span><span style="color: #66cc66;">&#40;</span>&amp;#34;&amp;#34;<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;jQuery<span style="color: #66cc66;">&#40;</span>&amp;#34;#order&amp;#34;<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">val</span><span style="color: #66cc66;">&#40;</span>&amp;#34;&amp;#34;<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #000066;">alert</span> <span style="color: #66cc66;">&#40;</span>data<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//jQuery(&amp;#34;#ajax-response&amp;#34;).show().html(data).fadeOut(5000);&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62; </div></li></ol></div>
</div></div><br />
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "Hibernate复合主键的配置及调用"</title>
<link>http://www.ll19.com/bb/topic/113#post-113</link>
<pubDate>Sun, 03 Jan 2010 16:24:53 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">113@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;实体&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljava-10"><a href="#" onclick="javascript:showPlainTxt('java-10'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-10">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #a1a100;">import java.io.Serializable;&amp;#60;/p&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #a1a100;">import javax.persistence.Column;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import javax.persistence.EmbeddedId;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import javax.persistence.Entity;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import javax.persistence.Table;&amp;#60;/p&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;@Entity&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@Table<span style="color: #66cc66;">&#40;</span>name = &amp;#34;FOR_GD_CONFIG&amp;#34;<span style="color: #66cc66;">&#41;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DbConfigEntity <span style="color: #000000; font-weight: bold;">implements</span> <a href="http://www.google.com/search?q=allinurl%3ASerializable+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Serializable</span></a> <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;@EmbeddedId&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> DbConfigPk allPk;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #808080; font-style: italic;">// @AttributeOverrides( {&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// @AttributeOverride(name = &amp;#34;fid&amp;#34;, column = @Column(name = &amp;#34;FLOWID&amp;#34;,&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// nullable = false)),&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// @AttributeOverride(name = &amp;#34;m&amp;#34;, column = @Column(name = &amp;#34;MARK&amp;#34;, nullable =&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">// false)) })&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> DbConfigPk getAllPk<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">allPk</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setAllPk<span style="color: #66cc66;">&#40;</span>DbConfigPk allPk<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">allPk</span> = allPk;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;@Column<span style="color: #66cc66;">&#40;</span>name = &amp;#34;MARK_CN&amp;#34;, nullable = <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> mC;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getMc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">mC</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setMc<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> mC<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">mC</span> = mC;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;@Column<span style="color: #66cc66;">&#40;</span>name = &amp;#34;COLUMN_NAME&amp;#34;, nullable = <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> cn;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getCn<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">cn</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setCn<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> cn<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">cn</span> = cn;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;实体中的复合主键&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljava-11"><a href="#" onclick="javascript:showPlainTxt('java-11'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-11">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package com.<span style="color: #006600;">rizon</span>.<span style="color: #006600;">lyj</span>.<span style="color: #006600;">gwgd</span>.<span style="color: #006600;">db</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #a1a100;">import java.io.Serializable;&amp;#60;/p&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #a1a100;">import javax.persistence.Column;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import javax.persistence.Embeddable;&amp;#60;/p&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #808080; font-style: italic;">/**&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * - 19. -&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * 复合主键~good luck~&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> *&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @author &amp;#60;a href=&amp;#34;http://www.LL19.com/&amp;#34;&amp;#62;LL19.com&amp;#60;/a&amp;#62;&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> * @version 1.0&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;"> */</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;@Embeddable&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DbConfigPk <span style="color: #000000; font-weight: bold;">implements</span> <a href="http://www.google.com/search?q=allinurl%3ASerializable+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Serializable</span></a> <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;@Column<span style="color: #66cc66;">&#40;</span>name = &amp;#34;FLOWID&amp;#34;, nullable = <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3ALong+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Long</span></a> fid;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3ALong+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Long</span></a> getFId<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">fid</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setFId<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ALong+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Long</span></a> fid<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">fid</span> = fid;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;@Column<span style="color: #66cc66;">&#40;</span>name = &amp;#34;MARK&amp;#34;, nullable = <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> m;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">m</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setM<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> m<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">m</span> = m;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;BEAN&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljava-12"><a href="#" onclick="javascript:showPlainTxt('java-12'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-12">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;public <span style="color: #000000; font-weight: bold;">class</span> DbConfigBean <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3ALong+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Long</span></a> fid;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3ALong+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Long</span></a> getFId<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">fid</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setFId<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3ALong+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Long</span></a> fid<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">fid</span> = fid;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> m;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getM<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">m</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setM<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> m<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">m</span> = m;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> mC;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getMc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">mC</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setMc<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> mC<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">mC</span> = mC;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> cn;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getCn<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">cn</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setCn<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> cn<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">cn</span> = cn;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;实体和BEAN的转换类&#60;br /&#62;
<div class="igBar"><span id="ljava-13"><a href="#" onclick="javascript:showPlainTxt('java-13'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-13">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;public <span style="color: #000000; font-weight: bold;">class</span> DbTools <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">static</span> DbConfigEntity toDbConfigEntity<span style="color: #66cc66;">&#40;</span>DbConfigBean bean<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>bean == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">null</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; DbConfigEntity entity = <span style="color: #000000; font-weight: bold;">new</span> DbConfigEntity<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;entity.<span style="color: #006600;">setCn</span><span style="color: #66cc66;">&#40;</span>bean.<span style="color: #006600;">getCn</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; DbConfigPk dbConfigPk = <span style="color: #000000; font-weight: bold;">new</span> DbConfigPk<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dbConfigPk.<span style="color: #006600;">setFId</span><span style="color: #66cc66;">&#40;</span>bean.<span style="color: #006600;">getFId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; dbConfigPk.<span style="color: #006600;">setM</span><span style="color: #66cc66;">&#40;</span>bean.<span style="color: #006600;">getM</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; entity.<span style="color: #006600;">setAllPk</span><span style="color: #66cc66;">&#40;</span>dbConfigPk<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; entity.<span style="color: #006600;">setMc</span><span style="color: #66cc66;">&#40;</span>bean.<span style="color: #006600;">getMc</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> entity;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">static</span> DbConfigBean toDbConfigBean<span style="color: #66cc66;">&#40;</span>DbConfigEntity entity<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>entity == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">null</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;DbConfigBean bean = <span style="color: #000000; font-weight: bold;">new</span> DbConfigBean<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; bean.<span style="color: #006600;">setCn</span><span style="color: #66cc66;">&#40;</span>entity.<span style="color: #006600;">getCn</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; bean.<span style="color: #006600;">setFId</span><span style="color: #66cc66;">&#40;</span>entity.<span style="color: #006600;">getAllPk</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getFId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; bean.<span style="color: #006600;">setM</span><span style="color: #66cc66;">&#40;</span>entity.<span style="color: #006600;">getAllPk</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getM</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; bean.<span style="color: #006600;">setMc</span><span style="color: #66cc66;">&#40;</span>entity.<span style="color: #006600;">getMc</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> bean;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;<span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;调用&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljava-14"><a href="#" onclick="javascript:showPlainTxt('java-14'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-14">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>service.<span style="color: #006600;">find0</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;DbConfigBean dbConfigBean = <span style="color: #66cc66;">&#40;</span>DbConfigBean<span style="color: #66cc66;">&#41;</span> service.<span style="color: #006600;">find0</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">get</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>dbConfigBean.<span style="color: #006600;">getFId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>dbConfigBean.<span style="color: #006600;">getM</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>service.<span style="color: #006600;">findMark</span><span style="color: #66cc66;">&#40;</span>&amp;#34;WHN&amp;#34;<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62; </div></li></ol></div>
</div></div><br />&#60;/p&#62;
&#60;p&#62;SERVICE中&#60;/p&#62;
&#60;p&#62;<div class="igBar"><span id="ljava-15"><a href="#" onclick="javascript:showPlainTxt('java-15'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-15">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> List&amp;#38;lt;DbConfigBean&amp;#38;gt; find0<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Criterion<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> criterion = <span style="color: #000000; font-weight: bold;">new</span> Criterion<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; criterion<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span> = Comparison.<span style="color: #006600;">eq</span><span style="color: #66cc66;">&#40;</span>&amp;#34;allPk.<span style="color: #006600;">fid</span>&amp;#34;, <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">long</span><span style="color: #66cc66;">&#41;</span> <span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; List&amp;#38;lt;DbConfigEntity&amp;#38;gt; entitys = <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">gbConfigDao</span>.<span style="color: #006600;">find</span><span style="color: #66cc66;">&#40;</span>criterion<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; List&amp;#38;lt;DbConfigBean&amp;#38;gt; beans = <span style="color: #000000; font-weight: bold;">new</span> ArrayList&amp;#38;lt;DbConfigBean&amp;#38;gt;<span style="color: #66cc66;">&#40;</span>entitys.<span style="color: #006600;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>DbConfigEntity entity : entitys<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beans.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>DbTools.<span style="color: #006600;">toDbConfigBean</span><span style="color: #66cc66;">&#40;</span>entity<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> beans;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #66cc66;">&#125;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;<span style="color: #000000; font-weight: bold;">public</span> List&amp;#38;lt;DbConfigBean&amp;#38;gt; findMark<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> Mark<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; Criterion<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> criterion = <span style="color: #000000; font-weight: bold;">new</span> Criterion<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; criterion<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span> = Comparison.<span style="color: #006600;">eq</span><span style="color: #66cc66;">&#40;</span>&amp;#34;allPk.<span style="color: #006600;">m</span>&amp;#34;, Mark<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; OrderBy<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> orders = <span style="color: #000000; font-weight: bold;">new</span> OrderBy<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; orders<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #66cc66;">&#40;</span>OrderBy.<span style="color: #006600;">asc</span><span style="color: #66cc66;">&#40;</span>&amp;#34;allPk.<span style="color: #006600;">fid</span>&amp;#34;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; List&amp;#38;lt;DbConfigEntity&amp;#38;gt; entitys = <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">gbConfigDao</span>.<span style="color: #006600;">find</span><span style="color: #66cc66;">&#40;</span>orders, criterion<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; List&amp;#38;lt;DbConfigBean&amp;#38;gt; beans = <span style="color: #000000; font-weight: bold;">new</span> ArrayList&amp;#38;lt;DbConfigBean&amp;#38;gt;<span style="color: #66cc66;">&#40;</span>entitys.<span style="color: #006600;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>DbConfigEntity entity : entitys<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beans.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>DbTools.<span style="color: #006600;">toDbConfigBean</span><span style="color: #66cc66;">&#40;</span>entity<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> beans;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "SPRING事务管理的一个例子"</title>
<link>http://www.ll19.com/bb/topic/112#post-112</link>
<pubDate>Sun, 03 Jan 2010 16:21:01 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">112@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;SPRING事务管理的一个例子&#60;br /&#62;
<div class="igBar"><span id="ljava-16"><a href="#" onclick="javascript:showPlainTxt('java-16'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">JAVA:</span><br /><div id="java-16">
<div class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/***&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; *&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; * 删除TAGS 需要同时删除tree_posts_tags表中的相关信息&amp;#60;br /&amp;#62;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp;&nbsp; */</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">int</span> removeTagsandPost<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> tagsID<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> countTags = &amp;#34;&amp;#34;;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">final</span> InvocationResult result = <span style="color: #000000; font-weight: bold;">new</span> InvocationResult<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;DataSourceTransactionManager tran = <span style="color: #000000; font-weight: bold;">new</span> DataSourceTransactionManager<span style="color: #66cc66;">&#40;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; getDataSource<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; TransactionTemplate trantemplate = <span style="color: #000000; font-weight: bold;">new</span> TransactionTemplate<span style="color: #66cc66;">&#40;</span>tran<span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;countTags = <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#41;</span> trantemplate.<span style="color: #006600;">execute</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> TransactionCallback<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?q=allinurl%3AObject+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> doInTransaction<span style="color: #66cc66;">&#40;</span>TransactionStatus status<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> sqlTags = &amp;#34;delete from tree_tags t where t.<span style="color: #006600;">t_id</span> = &amp;#34;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + NumberUtils.<span style="color: #006600;">toLong</span><span style="color: #66cc66;">&#40;</span>tagsID<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> sqlPostTags = &amp;#34;delete from tree_posts_tags t where t.<span style="color: #006600;">t_id</span> = &amp;#34;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + NumberUtils.<span style="color: #006600;">toLong</span><span style="color: #66cc66;">&#40;</span>tagsID<span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #993333;">int</span> count = getJdbcTemplate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">update</span><span style="color: #66cc66;">&#40;</span>sqlTags,&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AObject+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Object</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333;">int</span> countPostTags = getJdbcTemplate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">update</span><span style="color: #66cc66;">&#40;</span>sqlPostTags,&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AObject+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Object</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a>.<span style="color: #006600;">valueOf</span><span style="color: #66cc66;">&#40;</span>count + countPostTags<span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span>TransactionException te<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status.<span style="color: #006600;">setRollbackOnly</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>result.<span style="color: #006600;">getException</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> te;&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;color:#800000;">0</span>;&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&amp;#60;br /&amp;#62;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;&amp;#60;/p&amp;#62;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;#60;p&amp;#62;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">return</span> NumberUtils.<span style="color: #006600;">toInt</span><span style="color: #66cc66;">&#40;</span>countTags<span style="color: #66cc66;">&#41;</span>;&amp;#60;br /&amp;#62; </div></li></ol></div>
</div></div><br />
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "HIBERNATE复合主键的配置"</title>
<link>http://www.ll19.com/bb/topic/111#post-111</link>
<pubDate>Sun, 03 Jan 2010 16:17:59 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">111@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;1.通常将复合主键单独建一个类；&#60;br /&#62;
2.复合主键类必须实现java.io.Serializable接口，必须重写hashCode和 equals方法；&#60;br /&#62;
3.在映射文件中配置复合主键：&#60;br /&#62;
        &#38;lt;composite-id name=&#34;复合主键类名&#34;&#38;amp; gt;&#60;br /&#62;
            &#38;lt;key-property name=&#34;复合主键属性1&#34; column=&#34;对应字段名&#34; /&#38;gt;&#60;br /&#62;
            &#38;lt;key- property name=&#34;复合主键属性2&#34; column=&#34;对应字段名&#34; /&#38;gt;&#60;br /&#62;
        &#38;lt;/composite-id&#38;gt;&#60;/p&#62;
&#60;p&#62;hibernate.cfg.xml:&#60;/p&#62;
&#60;p&#62;&#38;lt;?xml version='1.0' encoding='UTF-8'?&#38;gt;&#60;br /&#62;
&#38;lt;!DOCTYPE hibernate-configuration PUBLIC&#60;br /&#62;
          &#34;-//Hibernate/Hibernate Configuration DTD 3.0//EN&#34;&#60;br /&#62;
          &#34;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&#34;&#38;gt;&#60;/p&#62;
&#60;p&#62;&#38;lt;!-- Generated by MyEclipse Hibernate Tools.                   --&#38;gt;&#60;br /&#62;
&#38;lt;hibernate-configuration&#38;gt;&#60;/p&#62;
&#60;p&#62;&#38;lt;session-factory&#38;gt;&#60;br /&#62;
    &#38;lt;property name=&#34;connection.username&#34;&#38;gt;scott&#38;lt;/property&#38;gt;&#60;br /&#62;
    &#38;lt;property name=&#34;connection.url&#34;&#38;gt;&#60;br /&#62;
        jdbc:oracle:thin:@127.0.0.1:1521:MGC&#60;br /&#62;
    &#38;lt;/property&#38;gt;&#60;br /&#62;
    &#38;lt;property name=&#34;dialect&#34;&#38;gt;&#60;br /&#62;
        org.hibernate.dialect.Oracle9Dialect&#60;br /&#62;
    &#38;lt;/property&#38;gt;&#60;br /&#62;
    &#38;lt;property name=&#34;myeclipse.connection.profile&#34;&#38;gt;MGC&#38;lt;/property&#38;gt;&#60;br /&#62;
    &#38;lt;property name=&#34;connection.password&#34;&#38;gt;tiger&#38;lt;/property&#38;gt;&#60;br /&#62;
    &#38;lt;property name=&#34;connection.driver_class&#34;&#38;gt;&#60;br /&#62;
        oracle.jdbc.driver.OracleDriver&#60;br /&#62;
    &#38;lt;/property&#38;gt;&#60;/p&#62;
&#60;p&#62;    &#38;lt;property name=&#34;show_sql&#34;&#38;gt;true&#38;lt;/property&#38;gt;&#60;br /&#62;
    &#38;lt;mapping&#60;br /&#62;
        resource=&#34;cn/edu/ahau/mgc/hibernate/pojo/YearPeriod.hbm.xml&#34; /&#38;gt;&#60;/p&#62;
&#60;p&#62;&#38;lt;/session-factory&#38;gt;&#60;/p&#62;
&#60;p&#62;&#38;lt;/hibernate-configuration&#38;gt;&#60;/p&#62;
&#60;p&#62;YearPeriodPK.java:&#60;/p&#62;
&#60;p&#62;package cn.edu.ahau.mgc.hibernate.pojo;&#60;/p&#62;
&#60;p&#62;import java.io.Serializable;&#60;/p&#62;
&#60;p&#62;public class YearPeriodPK implements Serializable{&#60;/p&#62;
&#60;p&#62;    private int year;&#60;br /&#62;
    private int period;&#60;/p&#62;
&#60;p&#62;    public int getYear() {&#60;br /&#62;
        return year;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public void setYear(int year) {&#60;br /&#62;
        this.year = year;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public int getPeriod() {&#60;br /&#62;
        return period;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public void setPeriod(int period) {&#60;br /&#62;
        this.period = period;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    @Override&#60;br /&#62;
    public int hashCode() {&#60;br /&#62;
        final int prime = 31;&#60;br /&#62;
        int result = 1;&#60;br /&#62;
        result = prime * result + period;&#60;br /&#62;
        result = prime * result + year;&#60;br /&#62;
        return result;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    @Override&#60;br /&#62;
    public boolean equals(Object obj) {&#60;br /&#62;
        if (this == obj)&#60;br /&#62;
            return true;&#60;br /&#62;
        if (obj == null)&#60;br /&#62;
            return false;&#60;br /&#62;
        if (getClass() != obj.getClass())&#60;br /&#62;
            return false;&#60;br /&#62;
        final YearPeriodPK other = (YearPeriodPK) obj;&#60;br /&#62;
        if (period != other.period)&#60;br /&#62;
            return false;&#60;br /&#62;
        if (year != other.year)&#60;br /&#62;
            return false;&#60;br /&#62;
        return true;&#60;br /&#62;
    }&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;YearPeriod.java:&#60;/p&#62;
&#60;p&#62;package cn.edu.ahau.mgc.hibernate.pojo;&#60;/p&#62;
&#60;p&#62;import java.util.Calendar;&#60;/p&#62;
&#60;p&#62;public class YearPeriod {&#60;/p&#62;
&#60;p&#62;    private YearPeriodPK yearPeriodPK;&#60;br /&#62;
    private Calendar beginDate;&#60;br /&#62;
    private Calendar endDate;&#60;/p&#62;
&#60;p&#62;    public YearPeriodPK getYearPeriodPK() {&#60;br /&#62;
        return yearPeriodPK;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public void setYearPeriodPK(YearPeriodPK yearPeriodPK) {&#60;br /&#62;
        this.yearPeriodPK = yearPeriodPK;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public Calendar getBeginDate() {&#60;br /&#62;
        return beginDate;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public void setBeginDate(Calendar beginDate) {&#60;br /&#62;
        this.beginDate = beginDate;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public Calendar getEndDate() {&#60;br /&#62;
        return endDate;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public void setEndDate(Calendar endDate) {&#60;br /&#62;
        this.endDate = endDate;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;YearPeriod.hbm.xml:&#60;/p&#62;
&#60;p&#62;&#38;lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#38;gt;&#60;br /&#62;
&#38;lt;!DOCTYPE hibernate-mapping PUBLIC &#34;-//Hibernate/Hibernate Mapping DTD 3.0//EN&#34;&#60;br /&#62;
&#34;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&#34;&#38;gt;&#60;br /&#62;
&#38;lt;!--&#60;br /&#62;
    Mapping file autogenerated by MyEclipse Persistence Tools&#60;br /&#62;
--&#38;gt;&#60;br /&#62;
&#38;lt;hibernate-mapping&#38;gt;&#60;br /&#62;
    &#38;lt;class name=&#34;cn.edu.ahau.mgc.hibernate.pojo.YearPeriod&#34; table=&#34;YEARPERIOD&#34; schema=&#34;SCOTT&#34;&#38;gt;&#60;br /&#62;
        &#38;lt;composite-id name=&#34;YearPeriodPK&#34;&#38;gt;&#60;br /&#62;
            &#38;lt;key-property name=&#34;year&#34; column=&#34;YEAR&#34; /&#38;gt;&#60;br /&#62;
            &#38;lt;key-property name=&#34;Period&#34; column=&#34;PERIOD&#34; /&#38;gt;&#60;br /&#62;
        &#38;lt;/composite-id&#38;gt;&#60;br /&#62;
        &#38;lt;property name=&#34;beginDate&#34; type=&#34;java.util.Calendar&#34; column=&#34;BEGINDATE&#34; /&#38;gt;&#60;br /&#62;
        &#38;lt;property name=&#34;endDate&#34; type=&#34;java.util.Calendar&#34; column=&#34;ENDDATE&#34; /&#38;gt;&#60;br /&#62;
    &#38;lt;/class&#38;gt;&#60;br /&#62;
&#38;lt;/hibernate-mapping&#38;gt;&#60;/p&#62;
&#60;p&#62;HibernateSessionFactory.java:&#60;/p&#62;
&#60;p&#62;package cn.edu.ahau.mgc.hibernate.many2one.factory;&#60;/p&#62;
&#60;p&#62;import org.hibernate.HibernateException;&#60;br /&#62;
import org.hibernate.Session;&#60;br /&#62;
import org.hibernate.cfg.Configuration;&#60;/p&#62;
&#60;p&#62;/**&#60;br /&#62;
 * Configures and provides access to Hibernate sessions, tied to the&#60;br /&#62;
 * current thread of execution.  Follows the Thread Local Session&#60;br /&#62;
 * pattern, see {@link &#60;a href=&#34;http://hibernate.org/42.html&#34; rel=&#34;nofollow&#34;&#62;http://hibernate.org/42.html&#60;/a&#62; }.&#60;br /&#62;
 */&#60;br /&#62;
public class HibernateSessionFactory {&#60;/p&#62;
&#60;p&#62;    /**&#60;br /&#62;
     * Location of hibernate.cfg.xml file.&#60;br /&#62;
     * Location should be on the classpath as Hibernate uses&#60;br /&#62;
     * #resourceAsStream style lookup for its configuration file.&#60;br /&#62;
     * The default classpath location of the hibernate config file is&#60;br /&#62;
     * in the default package. Use #setConfigFile() to update&#60;br /&#62;
     * the location of the configuration file for the current session.&#60;br /&#62;
     */&#60;br /&#62;
    private static String CONFIG_FILE_LOCATION = &#34;/hibernate.cfg.xml&#34;;&#60;br /&#62;
    private static final ThreadLocal&#38;lt;Session&#38;gt; threadLocal = new ThreadLocal&#38;lt;Session&#38;gt;();&#60;br /&#62;
    private  static Configuration configuration = new Configuration();&#60;br /&#62;
    private static org.hibernate.SessionFactory sessionFactory;&#60;br /&#62;
    private static String configFile = CONFIG_FILE_LOCATION;&#60;/p&#62;
&#60;p&#62;    static {&#60;br /&#62;
        try {&#60;br /&#62;
            configuration.configure(configFile);&#60;br /&#62;
            sessionFactory = configuration.buildSessionFactory();&#60;br /&#62;
        } catch (Exception e) {&#60;br /&#62;
            System.err&#60;br /&#62;
                    .println(&#34;%%%% Error Creating SessionFactory %%%%&#34;);&#60;br /&#62;
            e.printStackTrace();&#60;br /&#62;
        }&#60;br /&#62;
    }&#60;br /&#62;
    private HibernateSessionFactory() {&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    /**&#60;br /&#62;
     * Returns the ThreadLocal Session instance.  Lazy initialize&#60;br /&#62;
     * the &#60;code&#62;SessionFactory&#60;/code&#62; if needed.&#60;br /&#62;
     *&#60;br /&#62;
     *  @return Session&#60;br /&#62;
     *  @throws HibernateException&#60;br /&#62;
     */&#60;br /&#62;
    public static Session getSession() throws HibernateException {&#60;br /&#62;
        Session session = (Session) threadLocal.get();&#60;/p&#62;
&#60;p&#62;        if (session == null &#124;&#124; !session.isOpen()) {&#60;br /&#62;
            if (sessionFactory == null) {&#60;br /&#62;
                rebuildSessionFactory();&#60;br /&#62;
            }&#60;br /&#62;
            session = (sessionFactory != null) ? sessionFactory.openSession()&#60;br /&#62;
                    : null;&#60;br /&#62;
            threadLocal.set(session);&#60;br /&#62;
        }&#60;/p&#62;
&#60;p&#62;        return session;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    /**&#60;br /&#62;
     *  Rebuild hibernate session factory&#60;br /&#62;
     *&#60;br /&#62;
     */&#60;br /&#62;
    public static void rebuildSessionFactory() {&#60;br /&#62;
        try {&#60;br /&#62;
            configuration.configure(configFile);&#60;br /&#62;
            sessionFactory = configuration.buildSessionFactory();&#60;br /&#62;
        } catch (Exception e) {&#60;br /&#62;
            System.err&#60;br /&#62;
                    .println(&#34;%%%% Error Creating SessionFactory %%%%&#34;);&#60;br /&#62;
            e.printStackTrace();&#60;br /&#62;
        }&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    /**&#60;br /&#62;
     *  Close the single hibernate session instance.&#60;br /&#62;
     *&#60;br /&#62;
     *  @throws HibernateException&#60;br /&#62;
     */&#60;br /&#62;
    public static void closeSession() throws HibernateException {&#60;br /&#62;
        Session session = (Session) threadLocal.get();&#60;br /&#62;
        threadLocal.set(null);&#60;/p&#62;
&#60;p&#62;        if (session != null) {&#60;br /&#62;
            session.close();&#60;br /&#62;
        }&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    /**&#60;br /&#62;
     *  return session factory&#60;br /&#62;
     *&#60;br /&#62;
     */&#60;br /&#62;
    public static org.hibernate.SessionFactory getSessionFactory() {&#60;br /&#62;
        return sessionFactory;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    /**&#60;br /&#62;
     *  return session factory&#60;br /&#62;
     *&#60;br /&#62;
     *    session factory will be rebuilded in the next call&#60;br /&#62;
     */&#60;br /&#62;
    public static void setConfigFile(String configFile) {&#60;br /&#62;
        HibernateSessionFactory.configFile = configFile;&#60;br /&#62;
        sessionFactory = null;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    /**&#60;br /&#62;
     *  return hibernate configuration&#60;br /&#62;
     *&#60;br /&#62;
     */&#60;br /&#62;
    public static Configuration getConfiguration() {&#60;br /&#62;
        return configuration;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;ExportToDBCreate.java:&#60;/p&#62;
&#60;p&#62;package cn.edu.ahau.mgc.hibernate.export;&#60;/p&#62;
&#60;p&#62;import org.hibernate.cfg.Configuration;&#60;br /&#62;
import org.hibernate.tool.hbm2ddl.SchemaExport;&#60;/p&#62;
&#60;p&#62;public class ExportToDBCreate {&#60;/p&#62;
&#60;p&#62;    public static void main(String[] args) {&#60;br /&#62;
        Configuration cfg = new Configuration().configure();&#60;br /&#62;
        SchemaExport export = new SchemaExport(cfg);&#60;br /&#62;
        export.create(true, true);&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;InitData.java:&#60;/p&#62;
&#60;p&#62;package cn.edu.ahau.mgc.hibernate.export;&#60;/p&#62;
&#60;p&#62;import java.util.Calendar;&#60;/p&#62;
&#60;p&#62;import org.hibernate.Session;&#60;/p&#62;
&#60;p&#62;import cn.edu.ahau.mgc.hibernate.factory.HibernateSessionFactory;&#60;br /&#62;
import cn.edu.ahau.mgc.hibernate.pojo.YearPeriod;&#60;br /&#62;
import cn.edu.ahau.mgc.hibernate.pojo.YearPeriodPK;&#60;/p&#62;
&#60;p&#62;public class InitData {&#60;/p&#62;
&#60;p&#62;    public static void main(String[] args) {&#60;br /&#62;
        Session session = null;&#60;br /&#62;
        try {&#60;br /&#62;
            session = HibernateSessionFactory.getSession();&#60;br /&#62;
            session.beginTransaction();&#60;/p&#62;
&#60;p&#62;            YearPeriodPK yearPeriodPK = new YearPeriodPK();&#60;br /&#62;
            yearPeriodPK.setYear(2008);&#60;br /&#62;
            yearPeriodPK.setPeriod(1);&#60;/p&#62;
&#60;p&#62;            YearPeriod yearPeriod = new YearPeriod();&#60;br /&#62;
            yearPeriod.setYearPeriodPK(yearPeriodPK);&#60;br /&#62;
            Calendar beginDate = Calendar.getInstance();&#60;br /&#62;
            beginDate.set(2008, 2, 1);&#60;br /&#62;
            Calendar endDate = Calendar.getInstance();&#60;br /&#62;
            endDate.set(2008, 6, 1);&#60;br /&#62;
            yearPeriod.setBeginDate(beginDate);&#60;br /&#62;
            yearPeriod.setEndDate(endDate);&#60;/p&#62;
&#60;p&#62;            session.save(yearPeriod);&#60;br /&#62;
            session.getTransaction().commit();&#60;br /&#62;
        } catch (Exception e) {&#60;br /&#62;
            session.getTransaction().rollback();&#60;br /&#62;
            e.printStackTrace();&#60;br /&#62;
        } finally {&#60;br /&#62;
            HibernateSessionFactory.closeSession();&#60;br /&#62;
        }&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;LoadData.java:&#60;/p&#62;
&#60;p&#62;package cn.edu.ahau.mgc.hibernate.export;&#60;/p&#62;
&#60;p&#62;import java.text.SimpleDateFormat;&#60;/p&#62;
&#60;p&#62;import org.hibernate.Session;&#60;/p&#62;
&#60;p&#62;import cn.edu.ahau.mgc.hibernate.factory.HibernateSessionFactory;&#60;br /&#62;
import cn.edu.ahau.mgc.hibernate.pojo.YearPeriod;&#60;br /&#62;
import cn.edu.ahau.mgc.hibernate.pojo.YearPeriodPK;&#60;/p&#62;
&#60;p&#62;public class LoadData {&#60;/p&#62;
&#60;p&#62;    public static void main(String[] args) {&#60;br /&#62;
        Session session = null;&#60;br /&#62;
        try {&#60;br /&#62;
            session = HibernateSessionFactory.getSession();&#60;br /&#62;
            YearPeriodPK yearPeriodPK = new YearPeriodPK();&#60;br /&#62;
            yearPeriodPK.setYear(2008);&#60;br /&#62;
            yearPeriodPK.setPeriod(1);&#60;/p&#62;
&#60;p&#62;            YearPeriod yearPeriod = (YearPeriod) session.load(YearPeriod.class, yearPeriodPK);&#60;br /&#62;
            SimpleDateFormat sdf = new SimpleDateFormat(&#34;yyyy-MM-dd&#34;);&#60;br /&#62;
            System.out.println(&#34;Begin Date:&#34; + sdf.format(yearPeriod.getBeginDate().getTime()));&#60;br /&#62;
            System.out.println(&#34;End Date:&#34; + sdf.format(yearPeriod.getEndDate().getTime()));&#60;/p&#62;
&#60;p&#62;        } catch (Exception e) {&#60;br /&#62;
            e.printStackTrace();&#60;br /&#62;
        } finally {&#60;br /&#62;
            HibernateSessionFactory.closeSession();&#60;br /&#62;
        }&#60;br /&#62;
    }&#60;br /&#62;
}
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "Hibernate Annotation中BLOB、CLOB注解写法"</title>
<link>http://www.ll19.com/bb/topic/110#post-110</link>
<pubDate>Sun, 03 Jan 2010 16:16:48 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">110@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;Hibernate Annotation中BLOB、CLOB注解写法&#60;/p&#62;
&#60;p&#62;在hibernate Annotation中，实体BLOB、CLOB类型的注解与普通的实体属性有些不同，具体操作如下：BLOB类型，类型声明为byte[]：&#60;br /&#62;
private byte[] content；&#60;br /&#62;
注解：&#60;br /&#62;
@Lob&#60;br /&#62;
@Basic(fetch = FetchType.LAZY)&#60;br /&#62;
@Column(name = &#34;CONTENT&#34;, columnDefinition = &#34;BLOB&#34;,nullable=true)&#60;br /&#62;
public byte[] getContent() {&#60;br /&#62;
return this.content;&#60;br /&#62;
}&#60;br /&#62;
public void setContent(byte[] content) {&#60;br /&#62;
this.content = content;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;CLOB类型，类型声明为String即可：&#60;br /&#62;
private String remark；&#60;br /&#62;
注解：&#60;br /&#62;
@Lob&#60;br /&#62;
@Basic(fetch = FetchType.EAGER)&#60;br /&#62;
@Column(name=&#34;REMARK&#34;, columnDefinition=&#34;CLOB&#34;, nullable=true)&#60;br /&#62;
public String getRemark() {&#60;br /&#62;
return this.remark;&#60;br /&#62;
}&#60;br /&#62;
public void setRemark(String recvdocRemark) {&#60;br /&#62;
this.remark = remark;&#60;br /&#62;
}&#60;br /&#62;
按照以上的设置实体类的注解就搞定了。
&#60;/p&#62;</description>
</item>
<item>
<title>admin on "Hibernate的Ejb3注释进行映射"</title>
<link>http://www.ll19.com/bb/topic/109#post-109</link>
<pubDate>Sun, 03 Jan 2010 16:15:56 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid isPermaLink="false">109@http://www.ll19.com/bb/</guid>
<description>&#60;p&#62;参考文档&#60;br /&#62;
3.2.0 CR1&#60;br /&#62;
2.2.5. 映射实体Bean的关联关系&#60;br /&#62;
2.2.5.1. 一对一(One-to-one)&#60;br /&#62;
使用@OneToOne注解可以建立实体 bean之间的一对一的关联. 一对一关联有三种情况： 一是关联的实体都共享同样的主键, 二是其中一个实体通过外键关联到另一个实体的主键 (注意要模拟一对一关联必须在外键列上添加唯一约束). 三是通过关联表来保存两个实体之间的连接关系 (注意要模拟一对一关联必须在每一个外键上添加唯一约束).&#60;br /&#62;
首先,我们通过共享主键来进行一对一关联映射:&#60;br /&#62;
@Entity&#60;br /&#62;
public class Body {&#60;br /&#62;
    @Id&#60;br /&#62;
    public Long getId() { return id; }&#60;/p&#62;
&#60;p&#62;    @OneToOne(cascade = CascadeType.ALL)&#60;br /&#62;
    @PrimaryKeyJoinColumn&#60;br /&#62;
    public Heart getHeart() {&#60;br /&#62;
        return heart;&#60;br /&#62;
    }&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
@Entity&#60;br /&#62;
public class Heart {&#60;br /&#62;
    @Id&#60;br /&#62;
    public Long getId() { ...}&#60;br /&#62;
}&#60;br /&#62;
上面的例子通过使用注解@PrimaryKeyJoinColumn定 义了一对一关联.&#60;br /&#62;
下面这个例子使用外键列进行实体的关联.&#60;br /&#62;
@Entity&#60;br /&#62;
public class Customer implements Serializable {&#60;br /&#62;
    @OneToOne(cascade = CascadeType.ALL)&#60;br /&#62;
    @JoinColumn(name=&#34;passport_fk&#34;)&#60;br /&#62;
    public Passport getPassport() {&#60;br /&#62;
        ...&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Passport implements Serializable {&#60;br /&#62;
    @OneToOne(mappedBy = &#34;passport&#34;)&#60;br /&#62;
    public Customer getOwner() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
上面这个例子中,Customer 通过Customer 表中名为的passport_fk 外键列和 Passport关联. @JoinColumn注解定义了联接列(join column). 该注解和@Column注解有 点类似, 但是多了一个名为referencedColumnName的 参数. 该参数定义了所关联目标实体中的联接列. 注意,当referencedColumnName关联到非主键列的时候, 关联的目标类必须实现Serializable, 还要注意的是所映射的属性对应单个列(否则映射无效).&#60;br /&#62;
一对一关联可能是双向的.在双向关联中, 有且仅有一端是作为主体(owner)端存在的：主体端负责维护联接列(即更新). 对于不需要维护这种关系的从表则通过mappedBy属性进行声明. mappedBy的 值指向主体的关联属性. 在上面这个例子中,mappedBy的 值为 passport. 最后,不必也不能再在被关联端(owned side)定义联接列了,因为已经在主体端进行了声明.&#60;br /&#62;
如果在主体没有声明@JoinColumn, 系统自动进行处理： 在主表(owner table)中将创建联接列, 列名为：主体的关联属性名＋下划线＋被关联端的主键列名. 在上面这个例子中是passport_id, 因为Customer中关联属性名为passport, Passport的主键是id.&#60;br /&#62;
The third possibility (using an association table) is very exotic.&#60;br /&#62;
第三种方式也许是最另类的(通过关联表).&#60;br /&#62;
@Entity&#60;br /&#62;
public class Customer implements Serializable {&#60;br /&#62;
    @OneToOne(cascade = CascadeType.ALL)&#60;br /&#62;
    @JoinTable(name = &#34;CustomerPassports&#34;,&#60;br /&#62;
        joinColumns = @JoinColumn(name=&#34;customer_fk&#34;),&#60;br /&#62;
        inverseJoinColumns = @JoinColumn(name=&#34;passport_fk&#34;)&#60;br /&#62;
    )&#60;br /&#62;
    public Passport getPassport() {&#60;br /&#62;
        ...&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Passport implements Serializable {&#60;br /&#62;
    @OneToOne(mappedBy = &#34;passport&#34;)&#60;br /&#62;
    public Customer getOwner() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
Customer通过名为 CustomerPassports的关联表和 Passport关联; 该关联表拥有名为passport_fk的外键列,该 外键指向Passport表,该信息定义为inverseJoinColumn的属性值, 而customer_fk外键列指向Customer表, 该信息定义为 joinColumns的属性值.&#60;br /&#62;
这种关联可能是双向的.在双向关联中, 有且仅有一端是作为主体端存在的：主体端负责维护联接列(即更新). 对于不需要维护这种关系的从表则通过mappedBy属性进行声明. mappedBy的 值指向主体的关联属性. 在上面这个例子中,mappedBy的 值为 passport. 最后,不必也不能再在被关联端(owned side)定义联接列了,因为已经在主体端进行了声明.&#60;br /&#62;
你必须明确定义关联表名和关联列名.&#60;br /&#62;
2.2.5.2. 多对一(Many-to-one)&#60;br /&#62;
在实体属性一级使用@ManyToOne注 解来定义多对一关联:&#60;br /&#62;
@Entity()&#60;br /&#62;
public class Flight implements Serializable {&#60;br /&#62;
    @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )&#60;br /&#62;
    @JoinColumn(name=&#34;COMP_ID&#34;)&#60;br /&#62;
    public Company getCompany() {&#60;br /&#62;
        return company;&#60;br /&#62;
    }&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
其中@JoinColumn是可选的,关联 字段默认值和一对一 (one to one)关联的情况相似, 列名为：主体的关联属性名＋下划线＋被关联端的主键列名. 在这个例子中是company_id, 因为关联的属性是company, Company的主键是id.&#60;br /&#62;
@ManyToOne注解有一个名为targetEntity的参数, 该参数定义了目标实体名.通常不需要定义该参数, 因为在大部分情况下默认值(表示关联关系的属性类型)就可以很好的满足要求了. 不过下面这种情况下这个参数就显得有意义了：使用接口作为返回值而不是常见的实体.&#60;br /&#62;
@Entity()&#60;br /&#62;
public class Flight implements Serializable {&#60;br /&#62;
    @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, targetEntity=CompanyImpl.class )&#60;br /&#62;
    @JoinColumn(name=&#34;COMP_ID&#34;)&#60;br /&#62;
    public Company getCompany() {&#60;br /&#62;
        return company;&#60;br /&#62;
    }&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;public interface Company {&#60;br /&#62;
    ...&#60;br /&#62;
对于多对一也可以通过关联表的方式来映射。 通过@JoinTable注 解可定义关联表， 该关联表包含了指回实体表的外键(通过@JoinTable.joinColumns) 以及指向目标实体表的外键(通过@JoinTable.inverseJoinColumns).&#60;br /&#62;
@Entity()&#60;br /&#62;
public class Flight implements Serializable {&#60;br /&#62;
    @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )&#60;br /&#62;
    @JoinTable(name=&#34;Flight_Company&#34;,&#60;br /&#62;
        joinColumns = @JoinColumn(name=&#34;FLIGHT_ID&#34;),&#60;br /&#62;
        inverseJoinColumns = @JoinColumn(name=&#34;COMP_ID&#34;)&#60;br /&#62;
    )&#60;br /&#62;
    public Company getCompany() {&#60;br /&#62;
        return company;&#60;br /&#62;
    }&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
2.2.5.3. 集合类型&#60;br /&#62;
2.2.5.3.1. 概况&#60;br /&#62;
你可以对 Collection ,List (指有序列表, 而不是索引列表), Map和Set这几种类型进行映射. EJB3规范定义了怎么样使用@javax.persistence.OrderBy 注解来对有序列表进行映射： 该注解接受的参数格式：用逗号隔开的(目标实体)属性名及排序指令, 如firstname asc, age desc,如果该参数为空,则默认以id对该集合进行排序. 如果某个集合在数据库中对应一个关联表(association table)的话,你不能在这个集合属性上面使用@OrderBy注解. 对于这种情况的处理方法,请参考Hibernate Annotation Extensions. EJB3 允许你利用目标实体的一个属性作为Map的key, 这个属性可以用@MapKey(name=&#34;myProperty&#34;)来 声明. 如果使用@MapKey注解的时候不提供 属性名, 系统默认使用目标实体的主键. map的key使用和属性相同的列：不需要为map key定义专用的列，因为map key实际上就表达了一个目标属性。 注意一旦加载,key不再和属性保持同步, 也就是说,如果你改变了该属性的值,在你的Java模型中的key不会自动更新 (请参考Hibernate Annotation Extensions). 很多人被&#38;lt;map&#38;gt;和@MapKey弄糊涂了。 其他它们有两点区别.@MapKey目前还有一些限制,详情请查看论坛或者 我们的JIRA缺陷系统。 注意一旦加载,key不再和属性保持同步, 也就是说,如果你改变了该属性的值,在你的Java模型中的key不会自动更新. (Hibernate 3中Map支持的方式在当前的发布版中还未得到支持).&#60;br /&#62;
Hibernate将 集合分以下几类.&#60;br /&#62;
表 2.1. 集合语义&#60;br /&#62;
语义	Java实现类	注解&#60;br /&#62;
Bag 语义	java.util.List, java.util.Collection	@org.hibernate.annotations.CollectionOfElements 或 @OneToMany 或 @ManyToMany&#60;br /&#62;
List 语义	java.util.List	(@org.hibernate.annotations.CollectionOfElements 或 @OneToMany 或 @ManyToMany) 以及 @org.hibernate.annotations.IndexColumn&#60;br /&#62;
Set 语义	java.util.Set	@org.hibernate.annotations.CollectionOfElements 或 @OneToMany 或 @ManyToMany&#60;br /&#62;
Map 语义	java.util.Map	(@org.hibernate.annotations.CollectionOfElements 或 @OneToMany 或 @ManyToMany) 以及 (空 或 @org.hibernate.annotations.MapKey/MapKeyManyToMany(支 持真正的map), 或 @javax.persistence.MapKey&#60;br /&#62;
从上面可以明确地看到,没有@org.hibernate.annotations.IndexColumn 注解的java.util.List集合将被看作bag类.&#60;br /&#62;
EJB3规范不支持原始类型,核心类型,嵌入式对象的集合.但是Hibernate对此提供了支持 (详情参考 Hibernate Annotation Extensions).&#60;br /&#62;
@Entity public class City {&#60;br /&#62;
    @OneToMany(mappedBy=&#34;city&#34;)&#60;br /&#62;
    @OrderBy(&#34;streetName&#34;)&#60;br /&#62;
    public List&#38;lt;Street&#38;gt; getStreets() {&#60;br /&#62;
        return streets;&#60;br /&#62;
    }&#60;br /&#62;
...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity public class Street {&#60;br /&#62;
    public String getStreetName() {&#60;br /&#62;
        return streetName;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    @ManyToOne&#60;br /&#62;
    public City getCity() {&#60;br /&#62;
        return city;&#60;br /&#62;
    }&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Software {&#60;br /&#62;
    @OneToMany(mappedBy=&#34;software&#34;)&#60;br /&#62;
    @MapKey(name=&#34;codeName&#34;)&#60;br /&#62;
    public Map&#38;lt;String, Version&#38;gt; getVersions() {&#60;br /&#62;
        return versions;&#60;br /&#62;
    }&#60;br /&#62;
...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
@Table(name=&#34;tbl_version&#34;)&#60;br /&#62;
public class Version {&#60;br /&#62;
    public String getCodeName() {...}&#60;/p&#62;
&#60;p&#62;    @ManyToOne&#60;br /&#62;
    public Software getSoftware() { ... }&#60;br /&#62;
...&#60;br /&#62;
}&#60;br /&#62;
上面这个例子中,City 中包括了以streetName排序的Street的集合. 而Software中包括了以codeName作为 key和以Version作为值的Map.&#60;br /&#62;
除非集合为generic类型,否则你需要指定targetEntity. 这个注解属性接受的参数为目标实体的class.&#60;br /&#62;
2.2.5.3.2. 一对多(One-to-many)&#60;br /&#62;
在属性级使用 @OneToMany注解可 定义一对多关联.一对多关联可以是双向关联.&#60;br /&#62;
2.2.5.3.2.1. 双向(Bidirectional)&#60;br /&#62;
在EJB3规范中多对一这端几乎总是双向关联中的主体(owner)端, 而一对多这端的关联注解为@OneToMany( mappedBy=... )&#60;br /&#62;
@Entity&#60;br /&#62;
public class Troop {&#60;br /&#62;
    @OneToMany(mappedBy=&#34;troop&#34;)&#60;br /&#62;
    public Set&#38;lt;Soldier&#38;gt; getSoldiers() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Soldier {&#60;br /&#62;
    @ManyToOne&#60;br /&#62;
    @JoinColumn(name=&#34;troop_fk&#34;)&#60;br /&#62;
    public Troop getTroop() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
Troop 通过troop 属性和Soldier建立了一对多的双向关联. 在mappedBy端不必也不能再定义任何物理映射&#60;br /&#62;
对于一对多的双向映射,如果要一对多这一端维护关联关系, 你需要删除mappedBy元 素并将多对一这端的 @JoinColumn的 insertable和updatable设置为false. 很明显,这种方案不会得到什么明显的优化,而且还会增加一些附加的UPDATE语句.&#60;br /&#62;
@Entity&#60;br /&#62;
public class Troop {&#60;br /&#62;
    @OneToMany&#60;br /&#62;
    @JoinColumn(name=&#34;troop_fk&#34;) //we need to duplicate the physical information&#60;br /&#62;
    public Set&#38;lt;Soldier&#38;gt; getSoldiers() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Soldier {&#60;br /&#62;
    @ManyToOne&#60;br /&#62;
    @JoinColumn(name=&#34;troop_fk&#34;, insertable=false, updatable=false)&#60;br /&#62;
    public Troop getTroop() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
2.2.5.3.2.2. 单向(Unidirectional)&#60;br /&#62;
通过在被拥有的实体端(owned entity)增加一个外键列来实现一对多单向关联是很少见的,也是不推荐的. 我们强烈建议通过一个联接表(join table)来实现这种关联(下一节会对此进行解释). 可以通过@JoinColumn注解来描述这种单向关联关系.&#60;br /&#62;
@Entity&#60;br /&#62;
public class Customer implements Serializable {&#60;br /&#62;
    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)&#60;br /&#62;
    @JoinColumn(name=&#34;CUST_ID&#34;)&#60;br /&#62;
    public Set&#38;lt;Ticket&#38;gt; getTickets() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Ticket implements Serializable {&#60;br /&#62;
    ... //no bidir&#60;br /&#62;
}&#60;br /&#62;
Customer 通过 CUST_ID列和Ticket 建立了单向关联关系.&#60;br /&#62;
2.2.5.3.2.3. 通过关联表处理单向关联&#60;br /&#62;
通过联接表处理单向一对多关联是首选方式.这种关联通过@JoinTable注 解来进行描述.&#60;br /&#62;
@Entity&#60;br /&#62;
public class Trainer {&#60;br /&#62;
    @OneToMany&#60;br /&#62;
    @JoinTable(&#60;br /&#62;
            name=&#34;TrainedMonkeys&#34;,&#60;br /&#62;
            joinColumns = @JoinColumn( name=&#34;trainer_id&#34;),&#60;br /&#62;
            inverseJoinColumns = @JoinColumn( name=&#34;monkey_id&#34;)&#60;br /&#62;
    )&#60;br /&#62;
    public Set&#38;lt;Monkey&#38;gt; getTrainedMonkeys() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Monkey {&#60;br /&#62;
    ... //no bidir&#60;br /&#62;
}&#60;br /&#62;
上面这个例子中,Trainer通过 TrainedMonkeys表和 Monkey 建立了单向关联. 其中外键trainer_id关联到Trainer (joinColumns), 而外键monkey_id关联到 Monkey (inversejoinColumns).&#60;br /&#62;
2.2.5.3.2.4. 默认处理机制&#60;br /&#62;
通过联接表来建立单向一对多关联不需要描述任何物理映射. 表名由以下三个部分组成:主表(owner table)表名+下划线+从表(the other side table)表名. 指向主表的外键名：主表表名+下划线+主表主键列名 指向从表的外键名：主表所对应实体的属性名+下划线+从表主键列名 指向从表的外键定义为唯一约束,用来表示一对多的关联关系.&#60;br /&#62;
@Entity&#60;br /&#62;
public class Trainer {&#60;br /&#62;
    @OneToMany&#60;br /&#62;
    public Set&#38;lt;Tiger&#38;gt; getTrainedTigers() {&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Tiger {&#60;br /&#62;
    ... //no bidir&#60;br /&#62;
}&#60;br /&#62;
上面这个例子中,Trainer和Tiger 通过联接表 Trainer_Tiger建立单向关联关系, 其中外键trainer_id关联到Trainer (主表表名, _(下划线), trainer id), 而外键trainedTigers_id关联到Tiger (属性名称, _(下划线), Tiger表的主键列名).&#60;br /&#62;
2.2.5.3.3. 多对多(Many-to-many)&#60;br /&#62;
2.2.5.3.3.1. 定义&#60;br /&#62;
你可以通过@ManyToMany注解可定 义的多对多关联. 同时,你也需要通过注解@JoinTable描 述关联表和关联条件. 如果是双向关联,其中一段必须定义为owner,另一端必须定义为inverse(在对关联表进行更新操作时这一端将被忽略):&#60;br /&#62;
@Entity&#60;br /&#62;
public class Employer implements Serializable {&#60;br /&#62;
    @ManyToMany(&#60;br /&#62;
        targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,&#60;br /&#62;
        cascade={CascadeType.PERSIST, CascadeType.MERGE}&#60;br /&#62;
    )&#60;br /&#62;
    @JoinTable(&#60;br /&#62;
        name=&#34;EMPLOYER_EMPLOYEE&#34;,&#60;br /&#62;
        joinColumns=@JoinColumn(name=&#34;EMPER_ID&#34;),&#60;br /&#62;
        inverseJoinColumns=@JoinColumn(name=&#34;EMPEE_ID&#34;)&#60;br /&#62;
    )&#60;br /&#62;
    public Collection getEmployees() {&#60;br /&#62;
        return employees;&#60;br /&#62;
    }&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
@Entity&#60;br /&#62;
public class Employee implements Serializable {&#60;br /&#62;
    @ManyToMany(&#60;br /&#62;
        cascade = {CascadeType.PERSIST, CascadeType.MERGE},&#60;br /&#62;
        mappedBy = &#34;employees&#34;,&#60;br /&#62;
        targetEntity = Employer.class&#60;br /&#62;
    )&#60;br /&#62;
    public Collection getEmployers() {&#60;br /&#62;
        return employers;&#60;br /&#62;
    }&#60;br /&#62;
}&#60;br /&#62;
至此,我们已经展示了很多跟关联有关的声明定义以及属性细节. 下面我们将深入介绍@JoinTable注解,该注解定义了联接表的表名, 联接列数组(注解中定义数组的格式为{ A, B, C }), 以及inverse联接列数组. 后者是关联表中关联到Employee主键的列(the &#34;other side&#34;).&#60;br /&#62;
正如前面所示,被关联端不必也不能描述物理映射: 只需要一个简单的mappedBy参 数,该参数包含了主体端的属性名,这样就绑定双方的关系.&#60;br /&#62;
2.2.5.3.3.2. 默认值&#60;br /&#62;
和其他许多注解一样,在多对多关联中很多值是自动生成. 当双向多对多关联中没有定义任何物理映射时,Hibernate根据以下规则生成相应的值. 关联表名:主表表名+_下划线+从表表名, 关联到主表的外键名:主表名+_下划线+主表中的主键列 名. 关联到从表的外键名:主表中用于关联的属性名+_下 划线+从表的主键列名. 以上规则对于双向一对多关联同样有效.&#60;br /&#62;
@Entity&#60;br /&#62;
public class Store {&#60;br /&#62;
    @ManyToMany(cascade = CascadeType.PERSIST)&#60;br /&#62;
    public Set&#38;lt;City&#38;gt; getImplantedIn() {&#60;br /&#62;
        ...&#60;br /&#62;
    }&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class City {&#60;br /&#62;
    ... //no bidirectional relationship&#60;br /&#62;
}&#60;br /&#62;
上面这个例子中,Store_Table作 为联接表. Store_id列是联接到Store表的外键. 而implantedIn_id列则联接到City表.&#60;br /&#62;
当双向多对多关联中没有定义任何物理映射时, Hibernate根据以下规则生成相应的值 关联表名: :主表表名+_下划线+从表表名, 关联到主表的外键名:从表用于关联的属性名+_下划线+主表中的主键列名. 关联到从表的外键名:主表用于关联的属性名+_下划线+从表的主键列名. 以上规则对于双向一对多关联同样有效.&#60;br /&#62;
@Entity&#60;br /&#62;
public class Store {&#60;br /&#62;
    @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})&#60;br /&#62;
    public Set&#38;lt;Customer&#38;gt; getCustomers() {&#60;br /&#62;
        ...&#60;br /&#62;
    }&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Entity&#60;br /&#62;
public class Customer {&#60;br /&#62;
    @ManyToMany(mappedBy=&#34;customers&#34;)&#60;br /&#62;
    public Set&#38;lt;Store&#38;gt; getStores() {&#60;br /&#62;
        ...&#60;br /&#62;
    }&#60;br /&#62;
}&#60;br /&#62;
在上面这个例子中,Store_Customer作 为联接表. stores_id列是联接到Store表的外键, 而customers_id列联接到City表.&#60;br /&#62;
2.2.5.4. 用cascading实现传播性持久化(Transitive persistence)&#60;br /&#62;
也许你已经注意到了cascade属性接受 的值为CascadeType数组. 在EJB3中的cascade的概念和Hibernate中的传播性持久化以及cascade操作非常类似, 但是在语义上有细微的区别,支持的cascade类型也有点区别:&#60;br /&#62;
•	CascadeType.PERSIST: 如果一个实体是受管状态, 或者当persist()函数被调用时, 触发级联创建(create)操作&#60;br /&#62;
•	CascadeType.MERGE: 如果一个实体是受管状态, 或者当merge()函数被调用时, 触发级联合并(merge)操作&#60;br /&#62;
•	CascadeType.REMOVE: 当delete()函数被调用时, 触发级联删除(remove)操作&#60;br /&#62;
•	CascadeType.REFRESH: 当refresh()函数被调用时, 触发级联更新(refresh)操作&#60;br /&#62;
•	CascadeType.ALL: 以上全部&#60;br /&#62;
关于cascading, create/merge的语义请参考EJB3规范的6.3章节.&#60;br /&#62;
2.2.5.5. 关联关系获取&#60;br /&#62;
通过Hibernate你 可以获得直接或者延迟获取关联实体的功能. fetch参 数可以设置为FetchType.LAZY 或者 FetchType.EAGER. EAGER通过outer join select直接获取关联的对象, 而LAZY(默认值)在第一次访问关联对象的时候才会触发相应的select操作. EJBQL提供了fetch关键字,该关键字可以在进行特殊查询的时候覆 盖默认值. 这对于提高性能来说非常有效,应该根据实际的用例来判断是否选择fetch关键字.&#60;br /&#62;
2.2.6. 映射复合主键与外键&#60;br /&#62;
组合主键使用一个可嵌入的类作为主键表示,因此你需要使用@Id 和@Embeddable两个注解. 还有一种方式是使用@EmbeddedId注解. 注意所依赖的类必须实现 serializable以及实现equals()/hashCode()方法. 你也可以如Mapping identifier properties一章中描述的办法使用@IdClass注 解.&#60;br /&#62;
@Entity&#60;br /&#62;
public class RegionalArticle implements Serializable {&#60;/p&#62;
&#60;p&#62;    @Id&#60;br /&#62;
    public RegionalArticlePk getPk() { ... }&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;@Embeddable&#60;br /&#62;
public class RegionalArticlePk implements Serializable { ... }&#60;br /&#62;
或者&#60;br /&#62;
@Entity&#60;br /&#62;
public class RegionalArticle implements Serializable {&#60;/p&#62;
&#60;p&#62;    @EmbeddedId&#60;br /&#62;
    public RegionalArticlePk getPk() { ... }&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;public class RegionalArticlePk implements Serializable { ... }&#60;br /&#62;
@Embeddable 注解默认继承了其所属实体的访问类型, 除非显式使用了Hibernate的@AccessType注 解(这个注解不是EJB3标准的一部分). 而@JoinColumns, 即@JoinColumn数组, 定义了关联的组合外键(如果不使用缺省值的话). 显式指明referencedColumnNames是 一个好的实践方式, 否则,Hibernate认为你使用的列顺序和主键声明的顺序一致.&#60;br /&#62;
@Entity&#60;br /&#62;
public class Parent implements Serializable {&#60;br /&#62;
    @Id&#60;br /&#62;
    public ParentPk id;&#60;br /&#62;
    public int age;&#60;/p&#62;
&#60;p&#62;    @OneToMany(cascade=CascadeType.ALL)&#60;br /&#62;
    @JoinColumns ({&#60;br /&#62;
        @JoinColumn(name=&#34;parentCivility&#34;, referencedColumnName = &#34;isMale&#34;),&#60;br /&#62;
        @JoinColumn(name=&#34;parentLastName&#34;, referencedColumnName = &#34;lastName&#34;),&#60;br /&#62;
        @JoinColumn(name=&#34;parentFirstName&#34;, referencedColumnName = &#34;firstName&#34;)&#60;br /&#62;
    })&#60;br /&#62;
    public Set&#38;lt;Child&#38;gt; children; //unidirectional&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
@Entity&#60;br /&#62;
public class Child implements Serializable {&#60;br /&#62;
    @Id @GeneratedValue&#60;br /&#62;
    public Integer id;&#60;/p&#62;
&#60;p&#62;    @ManyToOne&#60;br /&#62;
    @JoinColumns ({&#60;br /&#62;
        @JoinColumn(name=&#34;parentCivility&#34;, referencedColumnName = &#34;isMale&#34;),&#60;br /&#62;
        @JoinColumn(name=&#34;parentLastName&#34;, referencedColumnName = &#34;lastName&#34;),&#60;br /&#62;
        @JoinColumn(name=&#34;parentFirstName&#34;, referencedColumnName = &#34;firstName&#34;)&#60;br /&#62;
    })&#60;br /&#62;
    public Parent parent; //unidirectional&#60;br /&#62;
}&#60;br /&#62;
@Embeddable&#60;br /&#62;
public class ParentPk implements Serializable {&#60;br /&#62;
    String firstName;&#60;br /&#62;
    String lastName;&#60;br /&#62;
    ...&#60;br /&#62;
}&#60;br /&#62;
注意上面的 referencedColumnName显 式使用方式.&#60;br /&#62;
2.2.7. 映射二级表(secondary tables)&#60;br /&#62;
使用类一级的 @SecondaryTable 或 @SecondaryTables 注解可以实 现单个实体到多个表的映射. 使用 @Column 或 者 @JoinColumn 注解中的 table 参数可指定某个列所属的特定表.&#60;br /&#62;
@Entity&#60;br /&#62;
@Table(name=&#34;MainCat&#34;)&#60;br /&#62;
@SecondaryTables({&#60;br /&#62;
    @SecondaryTable(name=&#34;Cat1&#34;, pkJoinColumns={&#60;br /&#62;
        @PrimaryKeyJoinColumn(name=&#34;cat_id&#34;, referencedColumnName=&#34;id&#34;)&#60;br /&#62;
    ),&#60;br /&#62;
    @SecondaryTable(name=&#34;Cat2&#34;, uniqueConstraints={@UniqueConstraint(columnNames={&#34;storyPart2&#34;})})&#60;br /&#62;
})&#60;br /&#62;
public class Cat implements Serializable {&#60;/p&#62;
&#60;p&#62;    private Integer id;&#60;br /&#62;
    private String name;&#60;br /&#62;
    private String storyPart1;&#60;br /&#62;
    private String storyPart2;&#60;/p&#62;
&#60;p&#62;    @Id @GeneratedValue&#60;br /&#62;
    public Integer getId() {&#60;br /&#62;
        return id;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    public String getName() {&#60;br /&#62;
        return name;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    @Column(table=&#34;Cat1&#34;)&#60;br /&#62;
    public String getStoryPart1() {&#60;br /&#62;
        return storyPart1;&#60;br /&#62;
    }&#60;/p&#62;
&#60;p&#62;    @Column(table=&#34;Cat2&#34;)&#60;br /&#62;
    public String getStoryPart2() {&#60;br /&#62;
        return storyPart2;&#60;br /&#62;
    }&#60;br /&#62;
在上面这个例子中,name保存在MainCat表中, storyPart1保存在Cat1表中, storyPart2保存在Cat2表中. Cat1表 通过外键cat_id和MainCat表关联, Cat2表通过id列和MainCat表 关联 (和MainCat的id列同名). 对storyPart2列还定义了唯一约束.&#60;br /&#62;
在JBoss EJB 3指南和Hibernate Annotations单元测试代码中还有更多的例子.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
