锘??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浜嗐?


]]>
主站蜘蛛池模板: 镇坪县| 稻城县| 绵竹市| 两当县| 砀山县| 神木县| 曲麻莱县| 吴川市| 正安县| 太保市| 集贤县| 林西县| 曲阜市| 丽江市| 岗巴县| 广灵县| 上杭县| 万年县| 将乐县| 抚宁县| 马龙县| 兴宁市| 揭东县| 汶川县| 垦利县| 甘德县| 正安县| 黑山县| 怀柔区| 襄樊市| 衡阳市| 庄浪县| 瓦房店市| 贵南县| 通辽市| 牙克石市| 德江县| 耿马| 闻喜县| 鄄城县| 清镇市|