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

怎么解析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)化
98精品偷拍视频一区二区三区| 国产91精品在线观看| 91伊人激情综合久久| 精品日韩欧美在线观看91| 超碰av之男人的天堂| 亚洲一本一道久久香蕉| 日本成熟亚洲中文字幕的| 91色老久久精品偷偷鲁无毒| 国产91日韩欧美在线| 亚洲精品一区二区影院| 欧美丰满老妇性猛交| 在线观看视频免费午夜| 日韩毛片资源在线观看| 国产经典午夜福利在线| 欧美日韩精品一区二区在线| 高清av中文免费在线| 91麻豆精品在线观看| 色婷婷国产精品高潮呻吟| 少妇高潮一区二区三区在线| 人人妻人人澡人人爽人人dvd| 人体艺术日韩色噜噜| 浮力草草日韩欧美三级| 国产免费久久黄av片| 亚洲综合美女极品啪啪啪| 18岁下禁止看的视频| 免费在线免费观看av| 久久精品国产亚洲av久| av免费在线不卡一区| 91出品国产福利在线| 99久久精品国产熟女| 日本熟女视频中文字幕| 午夜欧美日韩精品久久久| 日韩视频一区二区三区四区| 久久91亚洲精品中文字幕| 尤物视频网站在线观看| 国产av一级二级三级最新精品| 福利1中文字幕手机在线| 日本午夜视频一区二区| 又黄又湿又刺激中文字幕| 中文字幕午夜av福利| 日韩在线欧美在线一区二区|