JR 精品文章 - Hibernate - Inheritance strategy
AD: jr (at) javaresearch.org


首页 | 动态 | 文章 | FAQ  | 新闻 | 下载 | 代码 | 工作 | 调查 | 术语 | 站点 | 图书 | 论坛 | 帮助 | 全部  

TOP | 交流 | 软件 | 专栏 | 开源 | 译/著 | 源码 | API  | 推荐 | FTP  | 积分 | 统计 | 搜索 | Blog | 我们  
首页 » 研究文集 » 数据库相关 搜索标题相关文章 搜索标题相关文章    评论此文章 发表评论     开始监控此文章 开始监控   加入收藏夹  加入收藏夹
Hibernate - Inheritance strategy
sheldonsun 原创   更新:2007-06-01 12:30:48  版本: 1.0   

There are three kinds of basic strategies for inheritence mapping:
1. table per hierarchy.
2. table per subclass.
3. table per concreteclass.

Table structure maybe the root reason to determine which kind strategy will be used.

Table per hierarchy:
With subclass element.
A discriminator column will be used to distinguish subclass.
Limitation: no not null constraint on sub class's property.
Fault: redandance data will be generated.

Table per subclass:
With joined-class elment.
There are tables for super class and each subclass, for every subclass, key elemnt is used to referenced to super class's primary key, and all common properties will be stored in super table. The relation between super table and sub table is one-to-one.
Fault: complex table structure.


Table per concrete class:
With union-class elemnt.
Super class responsible for genrate id and all common properties wich will stored in sub table.
Fault: redandance data will be generated.
Limitation: all common column should used the same column name for the properties are defined in super class.

版权声明   给作者写信
本篇文章对您是否有帮助?  投票:         投票结果:     17       3
作者其它文章: 作者全部文章
评论人:oyj_t301 发表时间: Sat Jun 02 13:37:30 CST 2007
都是英文的,
哎,还要好好学习英语才行。[:(]
评论人:JUSTTOUR 发表时间: Mon Jun 04 20:14:13 CST 2007
这网站怎么这么烦人?下个几百k的东西还要积分,而且BUG一大把,恶心
评论人:ln831015 发表时间: Wed Jun 06 14:01:58 CST 2007
有没有不是英文的最近正在学这个 很晕看起来

这个文章共有 3 条评论
主题: 使用jdk1.5封箱及拆箱功能时注意的问题 上一篇文章
返回文章列表 返回〔数据库相关〕
下一篇文章 主题: Barcode功能说明


文字广告链接
        自主、快速定制基于JAVA的B/S业务系统          重量级企业在线自定义WEB报表平台
        Excel制表、零代码发布、打印、图表结合——快逸报表,免费、稳定、功能强大的java工具
        技术圈: 关于Java、dotNet、PHP、Ruby、奇客、Web2.0等更多资讯博客精选文章

关于 JR  |  版权声明  |  联系我们 

©2002-2006 JR 版权所有 沪ICP备05019622号