1、练习框架
<?xml version="1.0" encoding="UTF-8" ?>
<sqlMap namespace="TableEntity" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<alias>
<typeAlias alias="TableEntity" type="IBatisEntity.TableEntity" />
<!--<typeAlias alias="TableEntity.Key" type="long" />-->
</alias>
<resultMaps>
<resultMap id="TableEntity_AllColumns" class="TableEntity">
<result property="ID" column="ID" />
<result property="COL_1" column="COL_1" />
<result property="COL_2" column="COL_2" />
<result property="COL_3" column="COL_3" />
<result property="REFRESH_DATE" column="REFRESH_DATE" />
</resultMap>
</resultMaps>
<parameterMaps>
<parameterMap id="TableEntityParam" class="HashTable">
<parameter property="ID" column="ID" direction="Input" />
<parameter property="COL_1" column="COL_1" direction="Input" />
<parameter property="COL_2" column="COL_2" direction="Input" />
<parameter property="COL_3" column="COL_3" direction="Input" />
<parameter property="REFRESH_DATE" column="REFRESH_DATE" direction="Input" />
</parameterMap>
</parameterMaps>
<statements>
<insert id="TableEntity_Insert" parameterClass="TableEntity" resultClass="int">
<!-- 按照规范序列应该为
_S -->
<selectKey property="ID" type="pre" resultClass="long">
select pto_kit_s.nextval as value from dual
</selectKey>
INSERT INTO A_TEST_1
(ID, COL_1, COL_2, COL_3)
VALUES
(#ID#, #COL_1#, #COL_2#, #COL_3#)
</insert>
<select id="TableEntity_Select" parameterClass="TableEntity" resultMap="TableEntity_AllColumns">
select id,
col_1,
col_2,
col_3,
refresh_date
from scp.A_TEST_1 t where id=#ID#
</select>
<select id="TableEntity_Select_Datatable" parameterClass="TableEntity">
select id,
col_1,
col_2,
col_3,
refresh_date
from A_TEST_1 t where id=#ID#
</select>
</statements>
</sqlMap>
<?xml version="1.0" encoding="UTF-8" ?>
<sqlMap namespace="TableEntity" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<alias>
<typeAlias alias="TableEntity" type="IBatisEntity.TableEntity" />
<!--<typeAlias alias="TableEntity.Key" type="long" />-->
</alias>
<resultMaps>
<resultMap id="TableEntity_AllColumns" class="TableEntity">
<result property="ID" column="ID" />
<result property="COL_1" column="COL_1" />
<result property="COL_2" column="COL_2" />
<result property="COL_3" column="COL_3" />
<result property="REFRESH_DATE" column="REFRESH_DATE" />
</resultMap>
</resultMaps>
<parameterMaps>
<parameterMap id="TableEntityParam" class="HashTable">
<parameter property="ID" column="ID" direction="Input" />
<parameter property="COL_1" column="COL_1" direction="Input" />
<parameter property="COL_2" column="COL_2" direction="Input" />
<parameter property="COL_3" column="COL_3" direction="Input" />
<parameter property="REFRESH_DATE" column="REFRESH_DATE" direction="Input" />
</parameterMap>
</parameterMaps>
<statements>
<insert id="TableEntity_Insert" parameterClass="TableEntity" resultClass="int">
<!-- 按照规范序列应该为
_S -->
<selectKey property="ID" type="pre" resultClass="long">
select pto_kit_s.nextval as value from dual
</selectKey>
INSERT INTO A_TEST_1
(ID, COL_1, COL_2, COL_3)
VALUES
(#ID#, #COL_1#, #COL_2#, #COL_3#)
</insert>
<select id="TableEntity_Select" parameterClass="TableEntity" resultMap="TableEntity_AllColumns">
select id,
col_1,
col_2,
col_3,
refresh_date
from scp.A_TEST_1 t where id=#ID#
</select>
<select id="TableEntity_Select_Datatable" parameterClass="TableEntity">
select id,
col_1,
col_2,
col_3,
refresh_date
from A_TEST_1 t where id=#ID#
</select>
</statements>
</sqlMap>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理