惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

博客园 - BigKiteasdasd

招聘软件开发 javascript常用验证(转载) 人生很重要的一个开始 NStarfaiNet框架类关系简图 NStarfaiNet框架性能测试结果 NStarfaiNet框架代码生成器Version1。1 NStarfaiNet框架代码生成器 NstarfaiNet框架日志 NStarfaiNet 框架的使用示例(三) NStarfaiNet 框架的使用示例(二) NStarfaiNet 框架的使用示例(一) NStarfaiNet的SQL Map文件示范(maps/sample.xml) NStarfaiNet 的配置(dao_maps_config.config) NStarfaiNet 框架 iBatis.Net ParameterMap 怎样在C#中实现confirm() 动态添加附件上传按钮 常用javascript脚本 链接处变换色彩
学习配置篇1
BigKiteasdasd · 2006-05-31 · via 博客园 - BigKiteasdasd

IBatis不是一个ORM框架,而是一个半ORM,或者说Data Map。IbatisNet实际是一个PO与SQL之间的关系映射框架。也就是说,IbatisNet并不会为程序员在运行期自动生成SQL执行。具体的SQL需要程序员编写,然后通过映射配置文件,程序将SQL所需的参数传入,框架将映射好的结果返回。
优点:
1.简单易学。
    对于开发人员需要学习的东西比较少。
2.灵活。
    开发人员可以充分利用sql的强大功能。
3.对数据库的要求低。
    只要原先通过sql可以实现的功能,通过Ibatis几乎都能够实现。
4.除了数据映射DataMap,Ibatis还提供了DataAccess数据访问层框架,也就是DAO。
1.IbatisNet
(Ibatisfornet),作为一个轻量级的ORM框架,感觉还不错,在代码上只需要指定一下id,然后在xml中定义就好了,虽然还是写SQL,但是结构好了不少。
ibatisnet包括几个dll:
log4net.dll
IBatisNet.DataMapper.dll
IBatisNet.DataAccess.dll
IBatisNet.Common.dll
Castle.DynamicProxy.dll
其实我们用到的是IBatisNet.DataMapper.dll和IBatisNet.DataAccess.dll而已,其他的可以参见ibatis的文档,并无大用。
另外,ibatis包括一些配置文件,开始使用的时候,可能是版本上有点混乱,一些配置文件总是有问题,经过整理后,所需的配置文件如下:
providers.config
sqlmap.config
dao.config.
2.在providers.config中定义了一堆的数据库驱动.其中在dao.config中的database结点所对应的数据库驱动在该文件中的enabled属性必须为true,否则无法使用。
3.Maps目录下的xml文件主要包括几部分:
alias
resultMaps
statements
alias主要是对你在DotNet中定义的类作一个唯一的别名,注意,当复制一个xml文件内容做改写的时候一定要不要使用同一个alias,也就是说你在xml别名必须唯一.
4.sqlMaps :用来包含当前已经写好的,并且需要用到的数据类映射文件。

<sqlMaps>

        <!-- <sqlMap url="E:/Projet/iBatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/${directory}/MSSQL/SqlClient/Account.xml"/>   -->

        <sqlMap resource="Mappers/ContentMapper.xml"/>

        <!-- Rem : If used as embbeded Resources, use

        <sqlMap embedded="Maps.MSSQL.SqlClient.Account.xml, IBatisNet.DataMapper.Test"/>-->

</sqlMaps>