Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0
    • None
    • Core Library
    • None

    Description

      Implement horizontal inheritance. This requires:

      1. Allow dbEntityName attribute to be null in <obj-entity ...>
      2. Modeler changes to allow this to be set. Validation should require that any class set in this way should have at least one subclass.
      3. Changes, particularly to SelectQuery, which accomodates this change and returns the appropriate objEntities.

      Attachments

        1. bugfix_for_attr_table.patch
          1 kB
          Dzmitry Rusak
        2. Generate_sql_for_horizontal_inheritance.patch
          34 kB
          Dzmitry Rusak
        3. icon-override.gif
          0.1 kB
          Dzmitry Rusak
        4. Inheritance_modeler.patch
          22 kB
          Dzmitry Rusak
        5. inheritance-progress.diff
          27 kB
          Marcin Skladaniec
        6. modeler_embedded_attributes_fix.patch
          1 kB
          Dzmitry Rusak
        7. Overriding_attributes.patch
          14 kB
          Dzmitry Rusak
        8. Proper_attr_creating_typo.patch
          3 kB
          Dzmitry Rusak

        Issue Links

          Activity

            ari Ari Maniatis added a comment -

            It was agreed that for the first cut of this feature, it would be simpler to implement just abstract superclass implementations of horizontal inheritance. That is by far the most common scenario and avoids certain potential issues which would need to be checked for.

            ari Ari Maniatis added a comment - It was agreed that for the first cut of this feature, it would be simpler to implement just abstract superclass implementations of horizontal inheritance. That is by far the most common scenario and avoids certain potential issues which would need to be checked for.

            Hi
            I have tried to implement simple version of inheritance where there is a single abstract entity without a dbEntity, and two subclasses of this abstract entity with dbEntities.
            As for now i can commit new objects, but I cannot fetch. My debugging lead me to the SelectTranslator.java where I can see a correct number of RawDataRows being fetched, but when it is time to fault the rows into entities all falls apart. The persistent objects are created, but they always stay in HOLLOW state.
            I have tried to find the reason of this which this is happening, no luck so far. I'll attach diff of my working copy in a moment, maybe someone else can pick this up and see what am I doing wrong.

            marcin Marcin Skladaniec added a comment - Hi I have tried to implement simple version of inheritance where there is a single abstract entity without a dbEntity, and two subclasses of this abstract entity with dbEntities. As for now i can commit new objects, but I cannot fetch. My debugging lead me to the SelectTranslator.java where I can see a correct number of RawDataRows being fetched, but when it is time to fault the rows into entities all falls apart. The persistent objects are created, but they always stay in HOLLOW state. I have tried to find the reason of this which this is happening, no luck so far. I'll attach diff of my working copy in a moment, maybe someone else can pick this up and see what am I doing wrong.
            drusak Dzmitry Rusak added a comment -

            Add possibility to "override" attribute - change dbpath.

            drusak Dzmitry Rusak added a comment - Add possibility to "override" attribute - change dbpath.
            drusak Dzmitry Rusak added a comment -

            Move code for encoding overridden attribute from ObjAttribute to ObjEntity.

            drusak Dzmitry Rusak added a comment - Move code for encoding overridden attribute from ObjAttribute to ObjEntity.

            I applied the last Dzmitry's patch with only cosmetic changes. Now we need to address a few modeler issues with overriden attributes, before moving to runtime implementation.

            andrus Andrus Adamchik added a comment - I applied the last Dzmitry's patch with only cosmetic changes. Now we need to address a few modeler issues with overriden attributes, before moving to runtime implementation.
            drusak Dzmitry Rusak added a comment -

            Add necessary changes in modeler.

            drusak Dzmitry Rusak added a comment - Add necessary changes in modeler.

            let me grab this issue , as I am reviewing and applying patches from Dzmitry

            andrus Andrus Adamchik added a comment - let me grab this issue , as I am reviewing and applying patches from Dzmitry

            Hi, how can I test this feature?
            What does/doesn't work?
            Is there any docs on the issue?
            Thanks.

            gilbertoca Gilberto C Andrade added a comment - Hi, how can I test this feature? What does/doesn't work? Is there any docs on the issue? Thanks.

            Hi Gilberto,

            just like the last time when you were asking about JPA, here you ran across something on the edges of Cayenne. Unfortunately we dropped the ball on horizontal inheritance in 3.0 due to the lack of time by people who could make it happen (the implementation is rather deep and involved). I very much like to revive this effort in 3.1 beyond a few Modeler patches that we have in place so far. It is in my queue right after the new DI stuff.

            andrus Andrus Adamchik added a comment - Hi Gilberto, just like the last time when you were asking about JPA, here you ran across something on the edges of Cayenne. Unfortunately we dropped the ball on horizontal inheritance in 3.0 due to the lack of time by people who could make it happen (the implementation is rather deep and involved). I very much like to revive this effort in 3.1 beyond a few Modeler patches that we have in place so far. It is in my queue right after the new DI stuff.

            People

              andrus Andrus Adamchik
              ari Ari Maniatis
              Votes:
              6 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: