zoukankan      html  css  js  c++  java
  • mybatis跨XML引用

    resultMap中association标签的select属性使用嵌套查询的时候需要引用其它xml文件的配置

    此时可以用要引用xml的namespace.引用select的ID

    <resultMap id="BaseResultMap" type="com.jbt.pojo.SectorStaffInfo" >
    <id column="Id" property="id" jdbcType="INTEGER" />
    <result column="Position" property="position" jdbcType="VARCHAR" />
    <result column="Description" property="description" jdbcType="VARCHAR" />
    <result column="CreateDate" property="createdate" jdbcType="VARCHAR" />
    <association property="staffinfo" column="StaffInfo" select="com.jbt.dao.StaffInfoMapper.selectByPrimaryKey"/>
    <association property="sectorinfo" column="SectorInfo" select="com.jbt.dao.SectorInfoMapper.selectByPrimaryKey"/>
    </resultMap>

    要引用staffInfo中的selectByPrimaryKey来进行嵌套查询,则select="com.jbt.dao.StaffInfoMapper.selectByPrimaryKey"

  • 相关阅读:
    Servlet
    MySQL游标
    MySQL数据库的备份和还原
    MySQL安全管理
    MySQL存储过程
    MySQL联结——实现多表查询
    MySQL视图
    MySQL触发器
    asp.net core 读取连接字符串
    form表单提交前进行ajax验证
  • 原文地址:https://www.cnblogs.com/huhuixin/p/5691934.html
Copyright © 2011-2022 走看看