Book a Demo

Author Topic: DDL : define attribute types mapping rules  (Read 3655 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
DDL : define attribute types mapping rules
« on: April 03, 2012, 04:56:40 pm »
Hi,

I have a UML class diagram that I use to generate my DDL (e.g. in MySQL). I'd like to define custom rules to map class attribute types (including custom ones) to data types in MySQL

e.g. map String to nvarchar(255), map int to INTEGER, map largeint to BIGINT, etc.
This way I can reduce the amount of amendments on my DDL diagram once it's been generated from the class diagram.

thanks
Guillaume
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: DDL : define attribute types mapping rules
« Reply #1 on: April 03, 2012, 05:29:47 pm »
Guillaume,

I think you first need an MDA transformation form your PIM model (String) to a PSM model (nvarchar(255)).
Then you can use the standard ddl generation to generate the sql.

Geert

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: DDL : define attribute types mapping rules
« Reply #2 on: April 04, 2012, 04:43:06 pm »
Hi Geert,

Thanks for the info. I have to create a new template in the Transformation Templates (probably in the Attribute type).

I had a look at the DDL template and it contains the following script :
Column
{
  %TRANSFORM_CURRENT("type", "stereotype", "collection", "constant", "containment", "ordered", "static", "volatile")%
  type=%qt%%CONVERT_TYPE(genOptDefaultDatabase,attType)%%qt%
}

I'm not sure about the next step to achieve this : do I need to write my mapping rules there ? (e.g. map string to nvarchar(255), etc.) ?
I had a look at the Help section but it's not straightforward. A quick tutorial would be helpful


 
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: DDL : define attribute types mapping rules
« Reply #3 on: April 04, 2012, 05:07:02 pm »
Hi Guillaume,

I'm afraid my knowledge of those things is strictly theoretical :-[
I hope someone else will be able to help you with the practical side.

Geert

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: DDL : define attribute types mapping rules
« Reply #4 on: April 05, 2012, 02:17:00 am »
Thanks Geert - I'll update this thread if I make some progress.
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com