博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mybatis association和collection标签怎么用
阅读量:4568 次
发布时间:2019-06-08

本文共 1253 字,大约阅读时间需要 4 分钟。

  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>  

转载于:https://www.cnblogs.com/panxuejun/p/7476058.html

你可能感兴趣的文章
Redis过期命令
查看>>
Redis键的序列化和反序列化
查看>>
redis键的迁移操作
查看>>
redis字符串类型的基本命令
查看>>
redis哈希表数据类型键的设置
查看>>
redis字符串类型键的二进制操作
查看>>
redis哈希表数据类型键的查询和删除命令
查看>>
redis列表数据类型---list
查看>>
redis集合数据类型---SET
查看>>
php 字符串函数
查看>>
PHP数组函数
查看>>
PHP Math函数
查看>>
PHP Math常量
查看>>
idea使用git上传项目到coding
查看>>
SpringMVC+mybatis配置多数据源
查看>>
mybatis中条件查询大于等于和小于等于写法
查看>>
mybatis无法给带有下划线属性赋值问题
查看>>
java.lang.NoSuchMethodException: com.sun.tools.javac.util.List.<init>()
查看>>
Could not set property of class with value There is no setter for property named
查看>>
Could not find result map com.youotech.tl_cons_credit_rating.entity.Result
查看>>