Forum

"a table can't link to itself"  Unten

mumuri / 18. Jan 2009 / 20:02 Link zu diesem Beitrag


hi

"a table can't link to itself" why ?

i mean if we wan't to link an "object category" to itself, it's not possible (for a directory for instance)


Optionen

Rating

Antworten

  • Axel / 18. Jan 2009 / 20:35 Link zu diesem Beitrag

    Axel

    It's a known bug and will be solved with 0.5.0.


  • mumuri / 20. Jan 2009 / 20:38 Link zu diesem Beitrag


    ok , one last question, will inheritance be handled by the 0.5 ?


  • Axel / 20. Jan 2009 / 21:40 Link zu diesem Beitrag

    Axel

    If you mean inheritance on model level, then the answer is probably no, as this is not part of Persistence, but of Behavior sub editor icon_wink


  • mumuri / 31. Jan 2009 / 15:47 Link zu diesem Beitrag


    sorry i didn't understand you answer

    i will give an example

    MobileObject
    -----------------------
    motor
    WheelsNumber
    ^
    |
    |
    Car
    -----------------------
    Steering


    Moto
    -----------------------
    exhaust

    Moto extends MobileObject

    Car extends MobileObject

    MobileObject is abstrakt

    In your opinion, what will be the db schema for this model ? a one table for each sub object (car moto etc ...) , even if some class extending the first one (car moto etc ...) can have the same mobileObject properties?



    edited by: mumuri, Jan 31, 2009 - 05:53 PM


  • Axel / 01. Feb 2009 / 12:05 Link zu diesem Beitrag

    Axel

    As always there are different approaches available:

    1) You could only model MobileObject with something like a mobileType field. Depending on that field all additional properties of the concrete classes could be implemented / stored with attributes.

    2) Create all three tables in the persistence layer and connect them with one-to-one relations, something like "MobileObject ---- extends ---> Car". Then every Car or Moto instance has also the MobileObject properties available implicitely.

    Both are not real inheritance though. This is related to what I mentioned above: inheritance is no part of the whole persistence layer (at the moment). Either it will be added later (as a new relation type) or it will become part of the behavior layer (which corresponds to the green container elements in the main editor).

    I suggest to try out point 2) as it should basically do what you want. But keep in mind that this is not the same as if the object classes would extend from each other.


  • mumuri / 01. Feb 2009 / 16:21 Link zu diesem Beitrag


    2) was what i was going to do , but the problem, is that if you do like this you create two form one for MobileObject and one for Car (without the specific part)

    thanks anyway!


How to set up relations

8 Antworten
Axel on 15. Mai 2012 - 18:04



Neue Umfragen

Folgende Umfrage wurde noch nicht beantwortet:
Was soll in Zukunft verbessert werden?
 
 
 

ModuleStudio Honey

Schließen

You don't have permission to e-mail this story - please login