Inheritance strategy

          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.

          posted on 2007-06-01 10:55 Sheldon Sun 閱讀(259) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2007年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          導航

          統計

          常用鏈接

          留言簿(3)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 客服| 安国市| 梓潼县| 板桥市| 田阳县| 沛县| 文山县| 天门市| 冀州市| 岳池县| 安图县| 瑞安市| 高密市| 咸阳市| 东乌| 泗阳县| 汾阳市| 浦东新区| 西充县| 惠水县| 合川市| 通城县| 通化县| 定边县| 汝阳县| 五河县| 泰顺县| 波密县| 义乌市| 天峻县| 阳山县| 高雄市| 天水市| 合江县| 平山县| 泰安市| 吉林市| 云梦县| 资兴市| 楚雄市| 丹寨县|