在上一篇里面我们知道了什么是IbatisNet,并且知道了如何用IbatisNet进行简单的增删改查的操作,在这一篇文章里面我们主要介绍一下IbatisNet操作存储过程。

我们一般把存储过程分为两种类型:

1,查询类型的存储过程

也就是所谓的select语句

2,修改类型的存储过程

例如,insert,update,delete修改数据库数据的操作。

下面首先我们介绍一下查询类型的存储过程,为了使用我们建一个存储过程(以前很少用过现场百度的…………如果写的不好或者不对欢迎指正)

 create procedure pt_SelectByTj
@classes_name varchar(),
@classes_description varchar()
as
if(@classes_name is not null and @classes_description is not null)
begin
select * from dbo.calsses where classes_name like '%'+@classes_name+'%' and classes_description like '%'+@classes_description+'%';
end
if(@classes_name is not null and @classes_description is null)
begin
select * from dbo.calsses where classes_name like '%'+@classes_name+'%';
end
if(@classes_name is null and @classes_description is not null)
begin
select * from dbo.calsses where classes_description like '%'+@classes_description+'%';
end
if(@classes_name is null and @classes_description is null)
begin
select * from dbo.calsses;
end

查询的存储过程

然后我们要到xml里面去配置,在statements节点下面加一个procedure表示执行的是存储过程。其中parameterMap="swapParas"(swapParas的来历看下面的配置)

是参数类型 resultMap="SelectAllResult"(SelectAllResult的来历看下面的配置)是返回结果

   <statements>
<procedure id="GetClassesListByTj" parameterMap="swapParas" resultMap="SelectAllResult">
pt_SelectByTj
</procedure>
</statements>

代码

我们来看一下如何配置存储过程的参数条件(需要注意的是:这里面的顺序一定要和你在存储过程里面的顺序一样)

   <parameterMaps>
<parameterMap id="swapParas" class="Model.Calsses">
<parameter property="Name" column="classes_name" />
<parameter property="Description" column="classes_description" />
</parameterMap>
</parameterMaps>

代码

简单介绍这些属性的含义

parameterMap节点表示参数的集合,可以是一个实体,也可以是Hashtable,HashMap等数据结构。

parameter节点就是你的参数节点,property是你Hashtable里面的key值,column是你存储过程里面变量的名字,如果key值跟存储过程里面变量的名字相同的话column

可以为空。

下面介绍一下 resultMap="SelectAllResult"中SelectAllResult的来历

   <resultMaps>
<resultMap id="SelectAllResult" class="classes">
<result property="Id" column="calsses_id" />
<result property="Name" column="classes_name" />
<result property="Description" column="classes_description" />
</resultMap>
</resultMaps>

代码

在这里每一张表都对应一个实体,但是有时候我们的实体里面的属性跟我们的数据库字段对应不上,所以我们就在这里配置一下方便后面的使用。

看一下我们service类面的方法还是和以前一样调用

    /// <summary>
/// 根据条件查询全部额班级信息
/// </summary>
/// <param name="ht">参数</param>
/// <returns>查询的结果</returns>
public IList<Calsses> GetClassesListByTj(Hashtable ht)
{
return SqlMap.QueryForList<Calsses>("GetClassesListByTj", ht);
}

代码

下面是aspx.cs里面的方法

 protected void btn_select_Click(object sender, EventArgs e)
{
Hashtable table = new Hashtable();
table.Add("Name", txt_name.Text);
table.Add("Description", txt_name.Text);
gdv_list.DataSource = service.GetClassesListByTj(table);
gdv_list.DataBind();
}

代码

界面如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfIAAACfCAIAAACN7sy3AAAbsElEQVR4nO2d3aplV1bH11PkDfIWeQARctnkFRSkQchtohe5UVAErwJ60zZ6FxWkxYsmgoog2N1IJ6L5rqQqlTqnTp2POpVKVcXlRZntYo4x/uM/5lzfa/zYyD5zzTnGmOPjf/bZXd12fZIkSbIjuqUDSJIkScYkZT1JkmRXpKwnSZLsipT1JEmSXZGyniRJsitMWe+SJElo5pStBINkfc445mGXl9oiWYidkQVdFSnryQJkIXZGFnRV1Mg6+TdXxZ9mxRHGQugPw0Wab7p01R0cJmepP59XqwKL9La0Ztlf7dcd64zqsDiyrgolKaPuftUp6H4rTn4Apm6+mdNVHORji54dnUWcyhjmLBbIvHoELC5VNcDa4jk41Kf1aEeq66E+JqcrFEA/V/PNk65iJ5MrKzbm4LjMUwiG2YoVdaTW4rQyT5l4VhVMMrmsq40I+pjcgBfBZrlzdOZJF3jE7wfCMSnrUYGpi9UFsQLDIS3OOqM6LJPIurpBnQF5RG1x15c7JPJS0zFDukhrxaKVIsbXuMzjhWGpYrmOip2gfGtgPZEkfVTWZT/J3rI6D7Q+btwR+3ie5ps6XWADTlHUxXTM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+/8vrbapwp68kq2EEdd3CFpId1/Pb25rf+4Ke/+bt/+hfv/d2Hv/qXRV4f/OqfP/jlP/3t3//sN378J7/zR3+pxrkHWc/XPl5Lt1IriycwX2O9rBI/f/7su6c3v/9nf7OG/1+mP/7jv3r27FaNc/OyniRJkgxJWU+SJNkVKetJkiS7ImU9SZJkV/wvijHoWfva56EAAAAASUVORK5CYII=" alt="" />

好了,对于存储过程就先到这儿,这里面只写了一个查询的小例子,关于增删改的例子,就请读者自己去实现了,边学边练习才能学的更深入。

由于我也是初学者,如果文章中有什么不对或者遗漏的地方,欢迎大家指正………………

关于Ibatisnet的简单操作可以参照我的上一篇博客 跟初学者学习IbatisNet第一篇

本来还想在这一篇里面介绍一下Log4net呢,后来一想,还是留在下一篇来单独介绍一下如何用log4net记录日志吧。

源码下载:http://download.csdn.net/detail/woaixiaozhi/5826535

跟初学者学习IbatisNet第二篇的更多相关文章

  1. 跟初学者学习IbatisNet第一篇

    写在前面的话:我自己也是一个初学者,写这个专题只是为了对学过知识的巩固,如果有什么不对的地方,欢迎大家指正…………………… 第一篇就简单介绍一下什么是IbatisNet,然后写一个简单的Demo,在后 ...

  2. RabbitMQ学习总结 第二篇:快速入门HelloWorld

    目录 RabbitMQ学习总结 第一篇:理论篇 RabbitMQ学习总结 第二篇:快速入门HelloWorld RabbitMQ学习总结 第三篇:工作队列Work Queue RabbitMQ学习总结 ...

  3. 学习KnockOut第二篇之Counter

                                                                        学习KnockOut第二篇之Counter        欲看此 ...

  4. JavaWeb学习总结第二篇--第一个JavaWeb程序

    JavaWeb学习总结第二篇—第一个JavaWeb程序 最近我在学院工作室学习并加入到研究生的项目中,在学长学姐的带领下,进入项目实践中,为该项目实现一个框架(用已有框架进行改写).于是我在这里记录下 ...

  5. 老老实实学习WCF[第二篇] 配置wcf

    老老实实学WCF 第二篇 配置WCF 在上一篇中,我们在一个控制台应用程序中编写了一个简单的WCF服务并承载了它.先回顾一下服务端的代码: using System; using System.Col ...

  6. Egret入门学习日记 --- 第二篇 (书籍的选择 && 书籍目录 && 书中 3.3 节 内容)

    第二篇 (书籍的选择 && 书籍目录 && 书中 3.3 节 内容) 既然选好了Egret,那我就要想想怎么学了. 开始第一步,先加个Q群先,这不,拿到了一本<E ...

  7. 跟初学者学习IbatisNet第四篇

    这一章我们主要介绍一下IbatisNet里面的其它用法主要有以下几点: 1,如何得到运行时ibatis.net动态生成的SQL语句? 2,如何获取DbCommand? 3,如何返回DataTable, ...

  8. 跟初学者学习IbatisNet第三篇

    这一章我们主要介绍一下IbatisNet里面的动态sql语句的运用,比如有时候我们想进行模糊查询,参数是动态加入的.或者要实现top n ,order by ,分页等功能的时候,我们就不得不用动态拼接 ...

  9. Python学习【第二篇】Python入门

    Python入门 Hello World程序 在linux下创建一个叫hello.py,并输入 print("Hello World!") 然后执行命令:python hello. ...

随机推荐

  1. GCD Counting Codeforces - 990G

    https://www.luogu.org/problemnew/show/CF990G 耶,又一道好题被我浪费掉了,不会做.. 显然可以反演,在这之前只需对于每个i,统计出有多少(x,y),满足x到 ...

  2. 谷歌编码风格内容,新建一个xml文件,复制进去就可以在eclipse里面用了,命名--eclipse-java-google-style.xml

    <?xml version="1.0" encoding="UTF-8" standalone="no"?> <profi ...

  3. Varnish快速安装及测试

    实验环境: slave-147:   192.168.75.147 slave-148:    192.168.75.148 两台机器均已关闭selinux,关闭iptables. varnish部署 ...

  4. #pragma使用分析

    #pragma简介 #pragma用于指示编译器完成一些特定的动作 #pragma所定义的很多指示字是编译器特有的 #pragma在不同的编译器间是不可移植的 预处理器将忽略它不认识的#pragma指 ...

  5. elasticsearch 2.4.0安装说明

    首先从官网下载安装包,是个压缩文件,然后解压 在es目录下找到es的配置文件 修改集群(cluster)名称 PS:一般情况下一台机只部署一个es程序,也就是一个集群,默认集群名是ewater_mai ...

  6. 如何创建你的第一个手机APP?

    本文使用helloworld来作为android的入门项目,通过这个最简单的项目来帮助大家了解android程序开发包含哪些部分,以及如何运行android程序,本次开发android程序的工具是ec ...

  7. mysql登录(linux)

    一.修改配置文件 查询路径 find / -name my.cnf 修改文件 vi my.cnf [mysqld]下面加上skip-grant-tables 二.登录数据库 重启mysql servi ...

  8. docker 深入理解之cgroups

    cgroups 资源限制 cgroups 是什么 cgroups 最初名为process container,有Google工程师Paul Menage和Rohit Seth于 2006 年提出,后由 ...

  9. MySQL中外键删除、更新

      MySQL支持外键的存储引擎只有InnoDB..在创建外键的时候,可以指定在删除.更新父表时,对子表进行的相应操作,包括RESTRICT.NO ACTION.SET NULL和CASCADE. 其 ...

  10. intellij idea关闭重复代码提醒