zoukankan      html  css  js  c++  java
  • mybatis的resultMap中association配置

    <resultMap id="resultMap" type="Staff">
            <id property="id" column="id" javaType="Integer"></id>
            <result property="account" column="account" javaType="String"></result>
            <result property="password" column="password" javaType="String"></result>
            <result property="status" column="status" javaType="String"></result>
            <result property="did" column="did" javaType="Integer"></result>
            <result property="name" column="name" javaType="String"></result>
            <result property="sex" column="sex" javaType="String"></result>
            <result property="idNumber" column="id_number" javaType="String"></result>
            <result property="workTime" column="work_time" javaType="java.util.Date"></result>
            <result property="leaveTime" column="leave_tiem" javaType="java.util.Date"></result>
            <result property="bornDate" column="born_date" javaType="java.util.Date" ></result>
            <result property="info" column="info" javaType="String"></result>
            <association property="department" column="did" javaType="department" select="com.yzy.Dao.departmentDao.selectById"></association>
         <!--多对一时使用association,多个员工对应一个部门,column设置与department关联的列,select是将查询到的结果存放在department这个属性对象中,通过命名空间调用之前定义好的接口方法-->
    </resultMap>
  • 相关阅读:
    消费RabbitMQ时的注意事项,如何禁止大量的消息涌到Consumer,保证线程安全
    消费RabbitMQ时的注意事项,如何禁止大量的消息涌到Consumer,保证线程安全
    scrollTop值为0等疑难杂症
    9.四平方和
    8.冰雹数
    7.搭积木
    6.凑算式
    5.分小组
    4.骰子游戏
    3.平方怪圈
  • 原文地址:https://www.cnblogs.com/shouyaya/p/12748907.html
Copyright © 2011-2022 走看看