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 閱讀(264) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          <2007年6月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          1234567

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(3)

          隨筆檔案

          文章檔案

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 贺州市| 长武县| 十堰市| 习水县| 银川市| 望谟县| 辉南县| 三原县| 化德县| 图们市| 古蔺县| 陇川县| 东光县| 卢龙县| 安国市| 巢湖市| 安陆市| 周口市| 淳安县| 长治市| 赞皇县| 西充县| 延吉市| 乌恰县| 永胜县| 钟祥市| 哈尔滨市| 铁力市| 宣汉县| 讷河市| 堆龙德庆县| 朝阳市| 吴忠市| 曲沃县| 申扎县| 元谋县| 五家渠市| 北辰区| 恭城| 石狮市| 江西省|