如何进行iBATIS一对多映射的解析
如何进行iBATIS一对多映射的解析
这期内容当中小编将会给大家带来有关如何进行iBATIS一对多映射的解析,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
iBATIS一对多映射之中继VO如下属性:
publicclassRelayInfoVO{//中继信息privateStringbswitcherNames;//本端局privateStringdswitcherNames;//对端局privateStringsignalStatCount;//信令数privateStringrelayStatCount;//中继数privateListsignalVO;//信令List,用来存放信令List的……
iBATIS一对多映射信令VO如下属性:
publicclassSignalInfoVO{//信令信息privateStringbswitchers;//本端局privateStringdswitchers;//对端局privateStringsignalType;//信令类型privateStringsignalCount;//信令个数……
iBATIS的XML如下配置:
注:为中继
VO,column="{bswitcherNames=bswitcherName,dswitcherNames=DSWITCHERNAME}" 是为select="getSignalInfo"所传递的参数。select="getSignalInfo"为所要调用的SELECT查询语句。
﹤resultMapid="RelayInfoVO-Result-list"class="com.harvest.ermis.rscount.domain.RelayInfoVO"﹥﹤resultproperty="bswitcherNames"column="BSWITCHERNAME"nullValue=""/﹥﹤resultproperty="dswitcherNames"column="DSWITCHERNAME"nullValue=""/﹥﹤resultproperty="signalStatCount"column="SIGNALSTATCOUNT"nullValue=""/﹥﹤resultproperty="relayStatCount"column="RELAYSTATCOUNT"nullValue=""/﹥﹤resultproperty="signalVO"column="{bswitcherNames=bswitcherName,dswitcherNames=DSWITCHERNAME}"select="getSignalInfo"/﹥﹤/resultMap﹥
注:为信令VO
﹤resultMapid="SignalInfoVO-Result-list"class="com.harvest.ermis.rscount.domain.SignalInfoVO"﹥﹤resultproperty="bswitchers"column="BSWITCHERS"nullValue=""/﹥﹤resultproperty="dswitchers"column="DSWITCHERS"nullValue=""/﹥﹤resultproperty="signalType"column="SIGNALTYPE"nullValue=""/﹥﹤resultproperty="signalCount"column="SIGCOUTN"nullValue=""/﹥﹤/resultMap﹥﹤selectid="getRSInfo"resultMap="RelayInfoVO-Result-list"﹥……﹤/select﹥electid="getSignalInfo"resultMap="SignalInfoVO-Result-list"﹥selectc.switcherNameasBSWITCHERS,b.switcherNameasDSWITCHERS,linkTypeasSIGNALTYPE,count(*)asSIGCOUTNwherec.switcherName=#bswitcherNames#andb.switcherName=#dswitcherNames#groupbyb.switcherName,b.ATTACHING,c.switcherName,linktypeorderbyc.switcherName,b.SWITCHERORDER,linktype﹤/select﹥
iBATIS一对多映射的情况就介绍到这里,希望对你有所帮助。
上述就是小编为大家分享的如何进行iBATIS一对多映射的解析了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注亿速云行业资讯频道。
推荐阅读
-
JAVA实现HTML转PDF的五种方法详解
-
MySQL创建和删除索引命令CREATE/DROP INDEX使用方法详解
-
深入理解 JavaScript 原型和构造函数创建对象的机制
-
ZooKeeper和Eureka有什么区别?注册中心如何选择?
-
ZooKeeper是什么?分布式系统开发者必读入门指南
-
JavaScript防抖与节流函数怎么写?高频事件优化技巧详解
-
c++中sprintf函数使用方法及示例代码详解
在C++编程中,格式化输出是常见的需求。虽然cout提供了基本的输出功能,但在需要精确控制输出格式(如指定宽度、精度、进制等)...
-
Swagger 接口注解详解教程:@Api、@ApiOperation、@ApiModelProperty 全解析
-
Python变量命名规则全解析:打造规范、可读性强的代码风格
-
OpenSSL是什么?OpenSSL使用方法详解
