Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: ngchol on August 16, 2010, 09:40:53 pm

Title: A quick data modelling question...
Post by: ngchol on August 16, 2010, 09:40:53 pm
Hi all, this is my first post so sorry if I've missed the answer elsewhere...

I've created about 50 tables in a data model - they currently have no columns. Each table will contain a column called "<tablename> ID". Is there a macro I could easily create/run which could do this, or do I need to add each column manually?
Title: Re: A quick data modelling question...
Post by: Geert Bellekens on August 16, 2010, 10:14:57 pm
Have you tried creating a superclass that contains this one column, and having all other tables specialize this one?

This might just give you the desired results.

Geert

Title: Re: A quick data modelling question...
Post by: sargasso on August 16, 2010, 10:47:28 pm
Alternatively,

Since they are empty, why not delete the model, create a pseudo-table and then "Duplicate" it 50 times (its somewhere in the context menus).

Alternatively, as Geert suggests, use a more advanced rdms that supports inheritance.... (blatant plug for postgresql... (followed by blatant request that EA implement DDL generation that supports it!)).

<evil>hehehehehee</evil>
bruce
Title: Re: A quick data modelling question...
Post by: Aaron B on August 17, 2010, 09:09:25 am
Just as another suggestion - Running the built-in DDL transformation should automatically generate a default Primary Key "ID" column for each table.  The default format used for the column name is like "<TableName>ID".  You could customize the name format if needed by editing the DDL Transformation templates (specifically, look at the Class template).  Note: this process effectively creates an entire second copy of all your tables.  The original elements will not be modified.