IBastis配置实例
<?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><!--结果映射--><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><!--根据商品ID查询商品--><select id="SelectProductByProductID" parameterClass="int" resultClass="Product" extends="SelectAllProduct">WHERE ProductID=#PorductID#</select><!--获取所有产品的部分信息--><select id="SelectAllProductPartial" resultMap="ProductPartial">SELECT [ProductID],[ProductName],[SupplierID],[CategoryID],[QuantityPerUnit],[UnitPrice],[UnitsInStock],[UnitsOnOrder],[ReorderLevel],[Discontinued]FROM [Products]</select><!--通过两个条件或的关系查找--><!--通过字典传值--><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>
转载于:https://www.cnblogs.com/wjchang/archive/2013/01/24/3671548.html
IBastis配置实例相关推荐
- log4j2配置实例[按小时记录日志文件]
log4j2.xml文件配置实例:<?xml version="1.0" encoding="UTF-8"?> <configuration ...
- 地址设置nginx负载均衡_nginx负载均衡配置实例
什么是负载均衡? 负载均衡主要通过专门的硬件设备或者通过软件算法实现.通过硬件设备实现的负载均衡效果好.效率高.性能稳定,但是成本比较高.通过软件实现的负载均衡主要依赖于均衡算法的选择和程序的健壮性. ...
- 多 LDAP 目录服务器的 FileNet P8 系统介绍和配置实例
摘抄笔记:http://www.ibm.com/developerworks/cn/data/library/techarticle/dm-1312multipldap/ 多 LDAP 目录服务器的 ...
- proftpd的安装配置实例
为什么80%的码农都做不了架构师?>>> 一个proftpd的安装配置实例. 目的: 安装配置一个proftpd,达到以下要求 1 不允许匿名访问. 2 开放一个帐号 ...
- Cisco pix515配置实例
一.引言 硬件防火墙的应用,现在是越来越多,产品也很丰富.一般国产的防火墙多带有中文的说明和一些相应的配置实例,但国外的产品几乎都没有中文的说明书,这对一个初学者来说,尤其是中国的用户,是很不方便的, ...
- 命名式ACL配置实例
命名式ACL配置实例 稍微大一些的企业在网络管理中就要经常用到命名式的ACL配置.由于企业部门的分化,不同的部门需要不同ACL规则.其实配置ACL非常简单,首先命名一个ACL,然后进入将你所需要的AC ...
- nginx---ngix虚拟主机配置实例
2019独角兽企业重金招聘Python工程师标准>>> ngix虚拟主机配置实例 http://www.cnblogs.com/eoiioe/archive/2009/05/09/1 ...
- Nginx-07:Nginx配置实例之动静分离
Nginx配置实例之动静分离 1.动静分离概念 2.准备工作 image和www放静态资源. 3.具体配置 (1)在nginx的config中配置 autoindex on:列出当前文件夹中的文件 4 ...
- Nginx-06:Nginx配置实例之负载均衡
Nginx配置实例之负载均衡 目的:访问http://192.168.17.129/edu/a.html时平均的分配到8080和8081端口,即实现负载均衡的效果. 1.准备工作 (1)准备两台tom ...
最新文章
- Codeforces 336C 0-1背包
- 使用 yolov3训练 voc2012
- C++Adaline自适应线性神经网络算法(附完整源码)
- 苹果电脑无法用普通域用户加入域,用域管理员却可以,怎么破!?
- 【Spring 基础篇三】属性注入与属性编辑器
- 在linux下配置java,在Linux下配置Java开发环境
- 信息竞赛进阶指南--单调栈(模板)
- 实用的编程网站—良好的开端
- python多进程编程_python并发编程中的多进程(代码实现)
- solrcloud配置中文分词器ik
- MFC的HTML View在初始化时如何打开指定网页?
- html背景位置渐变,CSS3(背景和渐变)
- DOS的net命令详解
- ElasticSearch创建索引映射文档+IK分词器
- jq 清除ajax缓存,js清除浏览器缓存的几种方法
- 强烈推荐的程序员键盘--红轴手感好按键压力小写代码更轻松
- python训练Word2Vec词向量
- C# 操作MongoDB时间 时差问题
- Android 关于RemoteViews的理解(一)
- 个性化广告推荐系统(实战)-1-协同过滤篇