Modeler reengineered DataMap relationship naming problem

From: Jeff de Vries (jdevrie..frog.com)
Date: Sat Oct 29 2005 - 02:08:31 EDT

  • Next message: Adrian Wiesmann: "Re: CMS Advice"

    Would it be possible to have the Modeler, when it reverse engineers a
    database, to use the *field names* to generate relationship names
    instead of using the *types* to generate the names?

    Here's an example. Assume you have some tables like these (pseudo-SQL):

    CREATE TABLE person
    (
        id int4 PRIMARY KEY,
        ... other stuff
    )

    CREATE TABLE message
    (
        id int4 PRIMARY KEY,
        sender int4 FOREIGN KEY REFERENCES person(id),
        receiver int4 FOREIGN KEY REFERENCES person(id),
        original_message int4 FOREIGN KEY REFERENCES message(id),
        ... other stuff
    )

    After the Modeler reverse engineers the database, you get relationships
    named like this:
    [ObjEntity Message]
        toPerson [ message -> person ]
        toPerson1 [ message -> person ]
        toMessage [ message -> message ]
        messageArray [ message -> message, to many ]

    It's impossible from within the Modeler to tell whether toPerson or
    toPerson1 is, for example, the person referenced by the "sender" field.
    You have to go look at the XML file to figure it out. The
    ObjRelationship Inspector doesn't help, because it just shows [ message
    -> person ] without indicating which field it is using. You're stuck
    manually changing all the relationship names, either directly in the XML
    file, or, by looking at the XML file to decode what you're seeing in the
    Modeler.

    Wouldn't it be better to use the field names? Something like this:
    [ObjEntity Message]
        toSender [ message(sender) -> person(id) ]
        toReceiver [ message(receiver) -> person(id) ]
        toOriginalMessage [ message(original_message) -> message(id) ]
        originalMessageArray [this name still isn't quite right, but there
    wouldn't be any way for the Modeler to figure out it's actually the
    array of messages which refer back to this message and come up with a
    meaningful name for that].

    At least, can the Modeler indicate which fields are being used in the
    ObjRelationship Inspector?

    Thanks,
    Jeff de Vries



    This archive was generated by hypermail 2.0.0 : Sat Oct 29 2005 - 02:08:40 EDT