Book a Demo

Author Topic: Preventing new primary key when generating DDL dia  (Read 3420 times)

pstein

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Preventing new primary key when generating DDL dia
« on: December 02, 2010, 06:47:13 pm »
Assume I have a UML class diagram.
One of the attributes of classs "aaa" is "myid" which should be the primary key in a corresponding DDL diagram.

However when I transform the current UML class diagram into a DDL diagram then always automatically a new attribute (=column) is invented/created: PK_myclass(INTEGER) instead of using the intended myid as primary key.

How can I prevent the auto-generation of a new field/column and tell EA to use "myid" as primary key in the target DDL diagram?

Peter

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Preventing new primary key when generating DDL
« Reply #1 on: December 02, 2010, 06:53:40 pm »
There are two possible ways:

1) Modify the DDL generation scripts, the way I did it was to assign a tagged value with the name PK (value Yes) and attach this to the attribute to the primary key (or keys)

2) Name the primary key attribute ClassID, then this attribute will be the primary key

Cheers
Phil
Models are great!
Correct models are even greater!

pstein

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Re: Preventing new primary key when generating DDL
« Reply #2 on: December 03, 2010, 08:23:52 pm »
Hello Phil,

thank you, but some questions:

ad 2.) Do I really have to rename the primary key attribute to "classID" or did you mean to enable somewhere (where exactly ?) a checkbox with the property "classID" for the primary key attribute "myprimkey"?

ad1.) How do I modify the (default) DDL generation script? Where can I find it at all?

Peter

Quote
There are two possible ways:

1) Modify the DDL generation scripts, the way I did it was to assign a tagged value with the name PK (value Yes) and attach this to the attribute to the primary key (or keys)

2) Name the primary key attribute ClassID, then this attribute will be the primary key

Cheers
Phil