日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

IBastis配置实例

發(fā)布時間:2024/4/11 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 IBastis配置实例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
<?xml version="1.0" encoding="utf-8" ?><sqlMap namespace="Product" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><alias><!--商品別名--><typeAlias alias="Product" type="OMS.DTL.Entities.Product,OMS.DTL" /><!--商品部分屬性別名--><typeAlias alias="ProductPartial" type="OMS.DTL.Entities.ProductPartial,OMS.DTL"/><!--商品查詢條件別名--><typeAlias alias="ProductQueryCondition" type="OMS.DTL.Entities.ProductQueryCondition,OMS.DTL"/></alias><!--結(jié)果映射--><resultMaps><resultMap id="ProductPartial" class="ProductPartial"><result property="ProductID" column="ProductID"/><result property="ProductName" column="ProductName"/><result property="QuantityPerUnit" column="QuantityPerUnit"/><result property="UnitPrice" column="UnitPrice" /><result property="UnitsInStock" column="UnitsInStock"/></resultMap></resultMaps><statements><!--查詢所有商品--><select id="SelectAllProduct" resultClass="Product">SELECT [ProductID],[ProductName],[SupplierID],[CategoryID],[QuantityPerUnit],[UnitPrice],[UnitsInStock],[UnitsOnOrder],[ReorderLevel],[Discontinued]FROM [Products]</select><!--根據(jù)商品ID查詢商品--><select id="SelectProductByProductID" parameterClass="int" resultClass="Product" extends="SelectAllProduct">WHERE ProductID=#PorductID#</select><!--獲取所有產(chǎn)品的部分信息--><select id="SelectAllProductPartial" resultMap="ProductPartial">SELECT [ProductID],[ProductName],[SupplierID],[CategoryID],[QuantityPerUnit],[UnitPrice],[UnitsInStock],[UnitsOnOrder],[ReorderLevel],[Discontinued]FROM [Products]</select><!--通過兩個條件或的關(guān)系查找--><!--通過字典傳值--><select id="SelectProductByIDOrName" parameterClass="System.Collections.IDictionary" resultClass="Product" extends="SelectAllProduct">WHERE ProductID=#ProductID# OR ProductName=#ProductName# </select><!--通過類傳值--><select id="SelectProductBySupplierIDOrCategoryID" parameterClass="ProductQueryCondition" resultClass="Product" extends="SelectAllProduct">WHERE SupplierID=#SupplierID# OR CategoryID=#CategoryID#</select><!--插入操作--><insert id="Insert" parameterClass="Product">INSERT INTO [Products]([ProductName],[SupplierID],[CategoryID],[QuantityPerUnit],[UnitPrice],[UnitsInStock],[UnitsOnOrder],[ReorderLevel],[Discontinued])VALUES(#ProductName#,#SupplierID#,#CategoryID#,#QuantityPerUnit#,#UnitPrice#,#UnitsInStock#,#UnitsOnOrder#,#ReorderLevel#,#Discontinued#)<!--獲取自增列ID--><selectKey resultClass="int" type="post" property="ProductID" >select @@IDENTITY as value</selectKey></insert><!--更新操作--><update id="Update" parameterClass="System.Collections.IDictionary">update Productsset ProductName = #ProductName#where ProductID = #ProductID#</update><!--刪除操作--><delete id="Delete" parameterClass="int">Delete From ProductsWhere ProductID=#ProductID#</delete></statements></sqlMap>

轉(zhuǎn)載于:https://www.cnblogs.com/wjchang/archive/2013/01/24/3671548.html

總結(jié)

以上是生活随笔為你收集整理的IBastis配置实例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。