欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

怎么解析iBATIS.NET多數(shù)據(jù)庫支持

這篇文章給大家介紹怎么解析iBATIS.NET多數(shù)據(jù)庫支持,內(nèi)容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。

創(chuàng)新互聯(lián)建站是一家專注網(wǎng)站建設(shè)、網(wǎng)絡(luò)營銷策劃、成都微信小程序、電子商務(wù)建設(shè)、網(wǎng)絡(luò)推廣、移動互聯(lián)開發(fā)、研究、服務(wù)為一體的技術(shù)型公司。公司成立十余年以來,已經(jīng)為上千發(fā)電機租賃各業(yè)的企業(yè)公司提供互聯(lián)網(wǎng)服務(wù)?,F(xiàn)在,服務(wù)的上千客戶與我們一路同行,見證我們的成長;未來,我們一起分享成功的喜悅。

談到iBATIS.NET多數(shù)據(jù)庫支持我們首先來看看它本身的幫助文檔,在iBATIS.NET的幫助文檔中有介紹多數(shù)據(jù)庫支持,但是沒有寫全代碼,后來查看其源碼,并結(jié)合幫助文檔,找到了解決方法,其實道理就是另行實現(xiàn)一個Mapper.

iBATIS.NET多數(shù)據(jù)庫支持實例如AnthorMapper:

Apache Notice#region Apache Notice       #endregion           using IBatisNet.Common.Utilities;      using IBatisNet.DataMapper;      using IBatisNet.DataMapper.Configuration;           namespace IBatisNet.DataMapper      {          /**//// ﹤summary﹥         /// A singleton class to access the default SqlMapper defined by the SqlMap.Config          /// ﹤/summary﹥         public sealed class AnthorMapper          {             Fields#region Fields              private static volatile ISqlMapper _mapper = null;             #endregion                   /**//// ﹤summary﹥             ///               /// ﹤/summary﹥             /// ﹤param name="obj">﹤/param﹥             public static void Configure (object obj)              {                  _mapper = null;              }                   /**//// ﹤summary﹥             /// Init the 'default' SqlMapper defined by the SqlMap.Config file.              /// ﹤/summary﹥             public static void InitMapper()              {                  ConfigureHandler handler = new ConfigureHandler (Configure);                  DomSqlMapBuilder builder = new DomSqlMapBuilder();                  _mapper = builder.ConfigureAndWatch ("AnthorMap.config",handler);      }                   /**//// ﹤summary﹥             /// Get the instance of the SqlMapper defined by the SqlMap.Config file.              /// ﹤/summary﹥             /// ﹤returns>A SqlMapper initalized via the SqlMap.Config file.﹤/returns﹥             public static ISqlMapper Instance()              {                  if (_mapper == null)                  {                      lock (typeof (SqlMapper))                      {                          if (_mapper == null) // double-check                          {                                 InitMapper();                          }                      }                  }                  return _mapper;              }                            /**//// ﹤summary﹥             /// Get the instance of the SqlMapper defined by the SqlMap.Config file. (Convenience form of Instance method.)              /// ﹤/summary﹥             /// ﹤returns>A SqlMapper initalized via the SqlMap.Config file.﹤/returns﹥             public static ISqlMapper Get()              {                  return Instance();              }      }  }

以上代碼只是修改了iBATIS.NET中的Mapper的代碼,將_mapper = builder.ConfigureAndWatch (handler);修改為_mapper = builder.ConfigureAndWatch ("AnthorMap.config",handler),就是根據(jù)另一個AnthorMap.config文件來生成SqlMapper。

AnthorMap.config和默認的SqlMap.config一樣,只是根據(jù)你的數(shù)據(jù)不同設(shè)置不同而已,測試AnthorMap.config如下如下:

﹤?xml version="1.0" encoding="utf-8"?﹥    ﹤sqlMapConfig         xmlns="http://ibatis.apache.org/dataMapper"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"﹥           ﹤settings﹥            ﹤setting useStatementNamespaces="true"/﹥        ﹤/settings﹥           ﹤providers resource="ServerConfig/providers.config"/﹥           ﹤!-- Database connection information --﹥      ﹤database﹥        ﹤provider name="sqlServer2.0"/﹥        ﹤dataSource name="CrmSystem" connectionString="server=.;database=TestDB;uid=sa;pwd="/﹥      ﹤/database﹥             ﹤sqlMaps﹥        ﹤sqlMap embedded="Test.Domain.Weather.xml,Test.Domain" /﹥                     ﹤/sqlMaps﹥              ﹤/sqlMapConfig﹥

iBATIS.NET多數(shù)據(jù)庫支持之使用AntherMapper來創(chuàng)建ISqlMapper了。如下:

public IList﹤Weather﹥GetWeather()      {           ISqlMapper map = AnthorMapper.Instance();                return map.QueryForList﹤Weather>("Weather.Select", null);      }

那么iBATIS.NET多數(shù)據(jù)庫支持就介紹到這里。

關(guān)于怎么解析iBATIS.NET多數(shù)據(jù)庫支持就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。

分享名稱:怎么解析iBATIS.NET多數(shù)據(jù)庫支持
文章網(wǎng)址:http://aaarwkj.com/article44/gjdsee.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供電子商務(wù)網(wǎng)站收錄、做網(wǎng)站微信小程序、品牌網(wǎng)站設(shè)計、服務(wù)器托管

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化
亚洲综合av伊人久久| 色哟哟网站一区二区精品久久| 99热精品这里只有精品| 91蜜臀视频在线播放| 亚洲欧洲日本一区精品| 女人的天堂亚洲的天堂欧美| 欧美日韩亚洲中文二区| 一本色道av久久精品+| 日本欧美二区在线看| 国产偷人伦激情在线观看| 日韩欧美在线一区二区| 深夜视频在线观看成人| 无遮挡无掩盖的免费网站| 国产无遮挡又黄又爽网站| 日韩精品中文字幕有码| 蜜臀av首页在线观看| 无人区乱码一区二区三区| 日韩国产推荐一区二区| 激情av一区二区不卡| 五月激情开心久久婷婷| 少妇精品偷拍高潮少妇在线观看| 少妇太爽高潮在线播放| 手机黄色av免费在线网址 | 亚洲国产精品97视频| 国产老妇伦国产熟女高清| 亚洲另类偷拍校园伦理| 一区二区少妇黄色三区| 懂色一区二区三区精品视频| 免费高清av中文字幕| 日本加勒比在线播放一区| 久久五十路初次拍五十路| 日本黄色中文字幕在线观看 | 亚洲精品中国一区二区久久| 免费女同一区二区三区| 日本一区二区三区中文字幕不卡 | 亚洲成人av在线蜜桃| 久久精品国产亚洲熟女| 日本高清免费中文字幕| 国产精品三级久久久| 亚洲欧美一区二区色慰| 日韩电影中文字幕一区|