首页 > 其他 > 详细

mybatis association和collection标签怎么用

时间:2017-09-04 23:44:15      阅读:441      评论:0      收藏:0      [点我收藏+]
  1. <resultMap type="Bill" id="ResultBill">  
  2.            <id property="id" column="id"/>  
  3.            <result property="dh" column="dh"  />          
  4.            <result property="rq" column="rq"/>  
  5.            <association property="author"  javaType="Author"  >  
  6.               <id  property="id"  column="idAutor" />  
  7.               <result property="name" column="authorName" />  
  8.               <result property="email" column="authorEmail"/>  
  9.            </association>          
  10.            <collection property="det1"  javaType="ArrayList" ofType="BillDet1" >  
  11.               <id property="id" column="idDet1"/>  
  12.               <result property="dh" column="dhDet1"/>  
  13.               <result property="wlbm" column="wlbm"/>  
  14.               <result property="wlmc" column="wlmc"/>  
  15.               <result property="unit" column="unit"/>  
  16.               <result property="qty" column="qty"/>  
  17.            </collection>  
  1. </resultMap>  
  1. <resultMap type="com.sailod.shiro.dto.HtAuthorityMenuDTO" id="OneMenuAuthority">  
  2.         <id property="htAuthorityId" column="htAuthorityId" javaType="java.lang.Long" />  
  3.         <result property="name" column="name" javaType="java.lang.String" />  
  4.         <result property="currentUserId" column="currentUserId" javaType="java.lang.Long" />  
  5.         <collection property="htAuthorityDTO"  ofType="com.sailod.shiro.dto.HtAuthorityDTO"  
  6.          select="selectAuthority" column="{htAuthorityId2 = htAuthorityId ,currentUserId2 = currentUserId}"   >  
  7.          </collection>  
  8.     </resultMap>  

mybatis association和collection标签怎么用

原文:http://www.cnblogs.com/panxuejun/p/7476058.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!