Book a Demo

Author Topic: transformation Class diagram -> DDL  (Read 3865 times)

Martin32

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
transformation Class diagram -> DDL
« on: February 14, 2006, 07:36:13 am »
In class diagram I have two classes:
Book { title:string; author: Person; editor: Person }
Person {name:string }
and
associations:
Book.author -> "Person"
Book.editor -> "Person"

After transformation to DDL a received this tables:
Book ( (PK)bookID: integer;  (FK)PersonID:integer; title:string );
Person ( (PK) PersonID:integer; name:string)
and two same relations:
Book.PersonID -> Person.PersonID
Book.PersonID -> Person.PersonID :(

I lose author/editor information. What do I wrong?


thomaskilian

  • Guest
Re: transformation Class diagram -> DDL
« Reply #1 on: February 15, 2006, 02:33:14 am »
Enter "foreign key" in the Help search. Read the third section (DDL Transform...) to see an example.

Martin32

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: transformation Class diagram -> DDL
« Reply #2 on: February 15, 2006, 03:36:45 am »
I have already seen it but there is not "double association" in this exmaple.

thomaskilian

  • Guest
Re: transformation Class diagram -> DDL
« Reply #3 on: February 15, 2006, 03:48:27 am »
Quote
I have already seen it but there is not "double association" in this exmaple.

Because the primary key is created automatically and of type INTEGER. Your relations ar of type Person. It's not possible to map the foreign INT-key to person. Ergo, you have to manually work on the translation.

cnj_mike

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: transformation Class diagram -> DDL
« Reply #4 on: June 19, 2006, 11:18:40 am »
I'm using PK/FKs of type INT and I have the same problem.  I have two members of class Component as FK to class Item.  My intention is

CLASS Component
 FK container_id  (containerId=itemId)
 FK component_id (componentId=itemId)

but no joy.  Any way to transform the PIM to a DDL without having to write my own transform code?  Seems like a common need.

thomaskilian

  • Guest
Re: transformation Class diagram -> DDL
« Reply #5 on: June 19, 2006, 11:56:24 am »
Double FK does not work (yet). I hardly remember having read something that 6.5 will be able to deal with that...

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: transformation Class diagram -> DDL
« Reply #6 on: June 19, 2006, 12:26:10 pm »
Quote
Double FK does not work (yet). I hardly remember having read something that 6.5 will be able to deal with that...
Sparxians,
Don't forget you'll need to support multiple foreign keys with overlapping columns...  That is, a given column in a table may participate in more than one foreign key simultaneously.

As reported elsewhere in this forum, other products have difficulty with this.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!