锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久草在线看片,精品国产不卡,精品视频—区二区三区免费http://www.aygfsteel.com/baizhihui19870626/category/52778.html璁板綍鏈?/description>zh-cnFri, 12 Oct 2012 09:09:51 GMTFri, 12 Oct 2012 09:09:51 GMT60鍏充簬Ibatis insert鍚庤繑鍥炲間負null鐨勮В鍐沖姙娉曪紙杞級 http://www.aygfsteel.com/baizhihui19870626/articles/389469.html灝忕櫧19870626灝忕櫧19870626Fri, 12 Oct 2012 07:57:00 GMThttp://www.aygfsteel.com/baizhihui19870626/articles/389469.htmlhttp://www.aygfsteel.com/baizhihui19870626/comments/389469.htmlhttp://www.aygfsteel.com/baizhihui19870626/articles/389469.html#Feedback0http://www.aygfsteel.com/baizhihui19870626/comments/commentRss/389469.htmlhttp://www.aygfsteel.com/baizhihui19870626/services/trackbacks/389469.html
Java浠g爜
Executes a mapped SQL INSERT statement. Insert is a bit different from other update methods, as it provides facilities for returning the primary key of the newly inserted row (rather than the effected rows). This functionality is of course optional.

The parameter object is generally used to supply the input data for the INSERT values.

Parameters:
id - The name of the statement to execute.
parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).
Returns:
The primary key of the newly inserted row. This might be automatically generated by the RDBMS, or selected from a sequence table or other source.
Throws:
java.sql.SQLException - If an error occurs.

Executes a mapped SQL INSERT statement. Insert is a bit different from other update methods, as it provides facilities for returning the primary key of the newly inserted row (rather than the effected rows). This functionality is of course optional.

The parameter object is generally used to supply the input data for the INSERT values.

Parameters:
id - The name of the statement to execute.
parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).
Returns:
The primary key of the newly inserted row. This might be automatically generated by the RDBMS, or selected from a sequence table or other source.
Throws:
java.sql.SQLException - If an error occurs.


瀹冪殑鎰忔濇槸璇磋繑鍥炲兼槸鏂版彃鍏ヨ褰曠殑涓婚敭錛岀被鍨嬩負Object涓昏鏄洜涓轟富閿被鍨嬪彲浠ユ槸int涔熷彲浠ユ槸String綾誨瀷銆?

鐒惰岋紝濡傛灉鎴戜滑浣跨敤涓嬪垪鐨勯厤緗枃浠惰繘琛屾彃鍏ョ殑璇濓紝榪斿洖鐨勫間負null

Xml浠g爜
<insert id="insertPrdcategory" parameterClass="Prdcategory">
insert into Prdcategory ( name,pid,deep ) values ( #name#,
#pid#, #deep# )
</insert>

<insert id="insertPrdcategory" parameterClass="Prdcategory">
insert into Prdcategory ( name,pid,deep ) values ( #name#,
#pid#, #deep# )
</insert>

閭f垜浠鎬庢牱瑙e喅榪欎釜闂錛岃瀹冭繑鍥炴彃鍏ヨ鐨勪富閿憿錛岃繖鏃舵垜浠氨鏄嬌鐢ㄥ埌<selectKey>,涓嬮潰浠呬互MSSQL鏁版嵁搴撲負渚嬶紝鏀瑰啓涓婅堪閰嶇疆鏂囦歡錛屽叿浣撳涓嬶細



Xml浠g爜
<insert id="insertPrdcategory" parameterClass="Prdcategory">
insert into Prdcategory ( name,pid,deep ) values ( #name#,
#pid#, #deep# )
<selectKey resultClass="int" keyProperty="id">
select max(id) from Prdcategory
</selectKey>
</insert>

<insert id="insertPrdcategory" parameterClass="Prdcategory">
insert into Prdcategory ( name,pid,deep ) values ( #name#,
#pid#, #deep# )
<selectKey resultClass="int" keyProperty="id">
select max(id) from Prdcategory
</selectKey>
</insert>


DAO鐨勫疄鐜扮被鏂規硶閲岄潰灝卞簲璇ヨ繖鏍峰啓浜嗭紙娉ㄦ剰鏁村瀷杞崲鐢↖nteger綾誨悕錛?

Java浠g爜
public int insertPrdcategory(Prdcategory product) throws Exception {
return (Integer)IbatisUtil.getSqlMapper().insert("insertPrdcategory", product);
}

public int insertPrdcategory(Prdcategory product) throws Exception {
return (Integer)IbatisUtil.getSqlMapper().insert("insertPrdcategory", product);
}


榪欐牱灝辯畻鏄疧K浜嗐?


]]>
主站蜘蛛池模板: 肃南| 永吉县| 通山县| 高唐县| 江山市| 深州市| 历史| 丰原市| 渝中区| 和林格尔县| 伊宁市| 梨树县| 彩票| 祁门县| 六安市| 睢宁县| 奉贤区| 泌阳县| 鱼台县| 兖州市| 安图县| 伊宁县| 巴青县| 乐安县| 图片| 巴塘县| 洞头县| 隆林| 彩票| 唐河县| 游戏| 洮南市| 西畴县| 根河市| 秀山| 桦南县| 监利县| 惠东县| 桐柏县| 洪江市| 黄冈市|