Book a Demo

Author Topic: need help on DDL transformation template...  (Read 4329 times)

incanus

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
need help on DDL transformation template...
« on: February 13, 2007, 09:57:54 am »
I'm performing a DDL transformation, and i need that the field name of a primary key be set
to exampleID_PK instead of PK exampleID.
I know that i should modify the DDL transformation template, but idont know where i should
insert the changes.
Perhaps you could help and tell me in wich place or line insert the changes.
Best regards.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: need help on DDL transformation template...
« Reply #1 on: February 13, 2007, 01:12:33 pm »
The class template creates a primary key column and the connector template references that column in the foreign key target.  (They should match, otherwise the foreign key will create a column anyway.)

incanus

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: need help on DDL transformation template...
« Reply #2 on: February 16, 2007, 12:53:57 pm »
Hi Simonm, thanks for the answer.

In the class template i have:
name=%qt%%CONVERT_NAME(className, "Pascal Case","Camel Case")%ID%qt%

How should i modify this to set the name to exampleID_PK.

Best regards.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: need help on DDL transformation template...
« Reply #3 on: February 19, 2007, 02:50:04 pm »
Okay, I'm in tutor/teacher mode, so I'm not going to give you the answer.  Lets have a look at the different components of that line.
  • name= - Literal text, denotes that the following will string will specify the name.
  • %qt% - Generates a quote character to denote the start of the value for "name".
  • %CONVERT_NAME(className, "Pascal Case","Camel Case")% - Generates the name of the class with a lower case first letter.
  • ID - Literal text.
  • %qt% - Generates a quote character to denote the end of the value for "name".
So if you want to change that to generate exampleID_PK instead of exampleID, what do you need to change?

incanus

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: need help on DDL transformation template...
« Reply #4 on: February 20, 2007, 04:35:12 am »
simonm, thanks for the answer, it is precisely the kind of answer that i've been looking for, for now i really understand what that line does.
I should change to:
name=%qt%%CONVERT_NAME(className, "Pascal Case","Camel Case")%ID_PK%qt%

is it correct?.
Best regards.

thomaskilian

  • Guest
Re: need help on DDL transformation template...
« Reply #5 on: February 20, 2007, 05:04:02 am »
It is. Don't you have a playground where you can test the result?

incanus

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: need help on DDL transformation template...
« Reply #6 on: February 21, 2007, 07:27:32 am »
yes, i have, but i post it before testing the results, just to answer the question of mi tutor...
best regards...

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: need help on DDL transformation template...
« Reply #7 on: February 27, 2007, 02:47:30 pm »
Yes, as Thomas has said, that's correct.