Author Topic: [SOLVED] DDL Transformation: IDs  (Read 427 times)

Sepp

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
[SOLVED] DDL Transformation: IDs
« on: August 14, 2009, 09:24:01 pm »
Hi everyone

When applying DDL transformation on a class diagram, id's used for primary keys and aggregations are named in the manner of <table_name>ID, e.g. salesID.

What if I wanted the primary keys named only as 'id' and the aggregations only as the field names (so that a field "other" would transform to "other" rather than "otherID").

Is that possible with EA or do I have to adapt the generated diagram manually?

Thanks in advance for any reply and best regards
Seppi
« Last Edit: August 15, 2009, 07:46:01 am by UltimateSeppl »

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Arenīt we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: DDL Transformation: IDs
« Reply #1 on: August 14, 2009, 09:38:03 pm »
You will have to modify the DDL transformation template so that the naming is different. I did this once to accomplish a similar thing.

The documentation is not straightforward but the existing templates are somehow useful as an example.

Oliver

Sepp

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: DDL Transformation: IDs
« Reply #2 on: August 15, 2009, 07:45:07 am »
Thank you very much, that was exactly what I was looking for :) .

Adding the following changes did the trick:

Class:
name=%qt%id%qt%
instead of
name=%qt%%CONVERT_NAME(className, "Pascal Case","Camel Case")%ID%qt%

Connector:
name=%qt%id%qt%
instead of
name=%qt%%CONVERT_NAME(connectorSourceElemName, "Pascal Case","Camel Case")%ID%qt%

for generalization.


and

Connector:
name=%qt%%CONVERT_NAME(connectorDestElemName, "Pascal Case","Underscored")%%qt%
instead of
name=%qt%%CONVERT_NAME(connectorDestElemName, "Pascal Case","Camel Case")%ID%qt%

for all other aggregations.