department与employee是一对多关系。

set

<set name="emps" inverse="true">
<key column="depart_id"/>
<one-to-many class="Employee" />
</set>

list,关键在于有一定顺序:

<list name="emps">
<key column="depart_id" />
<list-index column="order_col" />
<one-to-many class="Employee" />
</list>

所以需要配置<list-index column="order_col" />

map: Map<Strig,Employee> emps;

<map name="emps">
<key column="depart_id" />
<map-key type="string" column="name"/>
<one-to-many class="Employee" />
</map>

bag:想用list又不需要保证顺序

<bag name="emps">
<key column="depart_id" />
<one-to-many class="Employee" />
</bag>

最新文章

  1. yoman 创建generator
  2. SharePoint 2013 状态机工作流之日常报销示例
  3. 「脑洞」图片转HTML(支持动画)
  4. 使用Html5+C#+微信 开发移动端游戏详细教程 :(三)使用html5引擎搭建游戏框架
  5. .NET中string[]数组和List&lt;string&gt;泛型的相互转换以及Array类的Sort()方法(转)
  6. example of Python http server
  7. ios之&quot;performSelector may cause a leak because its selector is unknown&quot;警告原因及其解决办法
  8. mybatis UpdateByExampleMapper UpdateByExampleSelectiveMapper
  9. JAVA 内存泄露的理解
  10. 对于deferred的一点点理解
  11. 使用Intent 将底层栈里所有的activity都清理掉
  12. HTML的语法
  13. cocos对lua代码加密
  14. Charles抓包工具使用
  15. [Error]Python虚拟环境报错 OSError: setuptools pip wheel failed with error code 2
  16. Some notes in Stanford CS106A(1)
  17. 测试md
  18. P3403 跳楼机
  19. Linux (OpenBSD)系统目录分析
  20. Hyper-V 与 VMware 和 vbox 的不兼容

热门文章

  1. mac安装Mysql官方示例数据库employee
  2. js中函数的定义
  3. ZT “樱花小萝莉”走红网络 网友:好想生个女儿
  4. jsp学习--JSP运行原理,九大隐式对象和JSP常用标签
  5. shell脚本学习--shell中的变量$
  6. python安装pycrypto报错error: command &#39;x86_64-linux-gnu-gcc&#39; failed with exit status 1
  7. python命令行参数
  8. 数据库管理员&lt;三&gt;
  9. AIX网络性能优化简介
  10. 团队博客作业Week1