zoukankan      html  css  js  c++  java
  • mybatis association和collection标签怎么用

    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>  
  • 相关阅读:
    C++ STL介绍——String类
    C++ STL介绍——简介
    使用anaconda安装tensorflow (windows10环境)
    JAVA面向对象编程课程设计——项目部署
    JAVA面向对象编程课程设计——web版斗地主
    JAVA面向对象编程课程设计——网络版单机斗地主
    在ASP.NET MVC中使用Web API和EntityFramework构建应用程序
    记一次类型设计的求索历程
    设计模式之策略模式在地铁票价系统中的应用
    C#中的var和dynamic
  • 原文地址:https://www.cnblogs.com/panxuejun/p/7476058.html
Copyright © 2011-2022 走看看