开发日志:hibernate映射,一个类映射多个表
来源:互联网 发布:加工中心软件编程 编辑:程序博客网 时间:2024/05/15 08:28
在解决项目中一个表字段映射多个实体属性的时候发现这个提问,觉得很有意思
一个User类有username,password属性,还有otherInformation等其他属性,username和password映射到一个表,otherInformation等其他属性映射到另一个表,使用User类时不会感觉到是两个表的的存在,如何配置User.mapping.xml文件进行配置?
这叫“Table per subclass”:
原:http://www.iteye.com/problems/4615
一个User类有username,password属性,还有otherInformation等其他属性,username和password映射到一个表,otherInformation等其他属性映射到另一个表,使用User类时不会感觉到是两个表的的存在,如何配置User.mapping.xml文件进行配置?
这叫“Table per subclass”:
<class name="Base" table="表1"> <id name="id" type="long" column="BASE_ID"> <generator class="native"/> </id> <property name="username" column="username"/> <property name="password" column="password"/> ... <joined-subclass name="User" table="表2"> <key column="BASE_ID"/> <property name="otherInformation" column="otherInformation"/> ... </joined-subclass> </class>
原:http://www.iteye.com/problems/4615
- 开发日志:hibernate映射,一个类映射多个表
- 开发日志:hibernate映射,使表中的一个字段对应实体中的多个属性
- hibernate映射文件开发
- hibernate一个实体类映射多张表
- Hibernate如何一个类映射两个表
- 一个复杂hibernate映射文件
- Hibernate类映射选项
- Hibernate映射Person类
- hibernate实体类映射
- Hibernate类映射文件
- 关联映射(hibernate映射)
- hibernate映射
- hibernate映射
- hibernate映射
- hibernate映射
- Hibernate 映射
- hibernate映射
- hibernate映射
- upstart
- LSA学习笔记
- mysql模糊查询匹配特殊字符
- 黑马程序员_java泛型
- linux ----install sogou
- 开发日志:hibernate映射,一个类映射多个表
- Java写音乐播放器 JMF的有关问题
- 执行sh脚本中的export对终端无效
- android--scrollview 高度的含义
- 黑马程序员_java类加载器
- Lopper;Handler;Message--Runnable和Activity交互
- freemarker+jstl自定义标签实现动态表单的显示
- (Relax 数论1.25)POJ 1850 Code(求某个字符串在字典中的位置)
- You think you use SharePoint but you really don't 你认为你使用了SharePoint,但是实际上不是