Hibernate中使用的集合类型
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>
最新文章
- yoman 创建generator
- SharePoint 2013 状态机工作流之日常报销示例
- 「脑洞」图片转HTML(支持动画)
- 使用Html5+C#+微信 开发移动端游戏详细教程 :(三)使用html5引擎搭建游戏框架
- .NET中string[]数组和List<;string>;泛型的相互转换以及Array类的Sort()方法(转)
- example of Python http server
- ios之";performSelector may cause a leak because its selector is unknown";警告原因及其解决办法
- mybatis UpdateByExampleMapper UpdateByExampleSelectiveMapper
- JAVA 内存泄露的理解
- 对于deferred的一点点理解
- 使用Intent 将底层栈里所有的activity都清理掉
- HTML的语法
- cocos对lua代码加密
- Charles抓包工具使用
- [Error]Python虚拟环境报错 OSError: setuptools pip wheel failed with error code 2
- Some notes in Stanford CS106A(1)
- 测试md
- P3403 跳楼机
- Linux (OpenBSD)系统目录分析
- Hyper-V 与 VMware 和 vbox 的不兼容
热门文章
- mac安装Mysql官方示例数据库employee
- js中函数的定义
- ZT “樱花小萝莉”走红网络 网友:好想生个女儿
- jsp学习--JSP运行原理,九大隐式对象和JSP常用标签
- shell脚本学习--shell中的变量$
- python安装pycrypto报错error: command &#39;x86_64-linux-gnu-gcc&#39; failed with exit status 1
- python命令行参数
- 数据库管理员<;三>;
- AIX网络性能优化简介
- 团队博客作业Week1