Author Topic: Copying Column Names  (Read 5393 times)

bmains

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Copying Column Names
« on: November 26, 2007, 10:03:26 am »
Hello,

When creating a data model, I was entering the same 4 columns over and over again (auditing fields).  Could I have entered it once, and copied it to the rest of the tables?  Is there an easier way to do that?

Thanks.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Copying Column Names
« Reply #1 on: November 26, 2007, 10:49:09 am »
Sorry, but none that I know of as yet. Nor does EA yet support any implementation of DBMS domains.
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Copying Column Names
« Reply #2 on: November 26, 2007, 11:09:16 am »
Quote
Hello,

When creating a data model, I was entering the same 4 columns over and over again (auditing fields).  Could I have entered it once, and copied it to the rest of the tables?  Is there an easier way to do that?

Thanks.
Hi, As  Midnight says, there is no way to implement domains.  However, there is an EASIER way to manually copy columns.  Just select them in the browser on the original table and drag them onto the new table on the diagram.  Ea will make a copy of the fields.

Obviously, there is no way to "remember" this in the target table.  But it is easier and more consistent than creating the columns afresh for each table.

I have yet to investigate the DDL transformation templates but you might be able to use EA's inheritance technology to create "aspects" (such as auditing or footprinting) and get the DDL template to follow the inheritance path to generate the "inherited" columns.  That way , if you change the parent and regenerate you should get a now outcome.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Copying Column Names
« Reply #3 on: November 26, 2007, 11:24:01 am »
Thanks Paolo,

I simply had not thought of the drag and drop approach, though it works in other places too.

As for the inheritance idea, it sounds like it's worth a try. Just one caution though. Do not change the stereotypes; leave them as «table» and «column». Others have tried changing these in inheritance hierarchies. Due to the way EA handles the «table» and «column» stereotypes, the results have been both unpredictable and unsatisfactory.

David
« Last Edit: November 26, 2007, 11:24:23 am by Midnight »
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Copying Column Names
« Reply #4 on: November 26, 2007, 11:42:50 am »
If you're wanting a common set of columns across all tables created, try setting up a template package and add a table with the required columns to it.  From there all new tables created should have the attributes in the template package.

See http://www.sparxsystems.com.au/EAUserGuide/index.html?using_element_templates.htmhttp://

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Copying Column Names
« Reply #5 on: November 26, 2007, 12:08:47 pm »
Quote
If you're wanting a common set of columns across all tables created, try setting up a template package and add a table with the required columns to it.  From there all new tables created should have the attributes in the template package.

See http://www.sparxsystems.com.au/EAUserGuide/index.html?using_element_templates.htmhttp://
But Simon...  When bmains says all he means almost all - in fact he may mean less than 80%!   :)

Paolo
« Last Edit: November 26, 2007, 12:09:28 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Copying Column Names
« Reply #6 on: November 26, 2007, 01:06:18 pm »
Quote
But Simon...  When bmains says all he means almost all - in fact he may mean less than 80%!   :)

Yes, I fully realise the natural tendency to overstate things.  Regardless of that, I was just offering it as something that may help.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Copying Column Names
« Reply #7 on: November 26, 2007, 03:17:24 pm »
Quote
Yes, I fully realize the natural tendency to overstate things.  Regardless of that, I was just offering it as something that may help.
And my response, not a criticism, just a wry observation on how we all specify requirements...

Paolo
« Last Edit: November 26, 2007, 09:36:41 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

peter.zrnko

  • EA User
  • **
  • Posts: 253
  • Karma: +0/-0
    • View Profile
Re: Copying Column Names
« Reply #8 on: November 26, 2007, 08:28:33 pm »
It's possible to drag an attribute from project browser onto an classifier on a diagram and thus copying this attribute.

It's possible to copy an attribute in Attributes dialog using the Copy button nearly for every classifier but a table. Why it's not possible to copy a column of a table using the Copy button?

Consistency, consistency, consistency ...      as somebody else said many times  :(
Peter

bmains

  • EA Novice
  • *
  • Posts: 19
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Copying Column Names
« Reply #9 on: December 07, 2007, 05:55:11 am »
Thanks all for the help.  By the way, I'm using EA 6.5.  Somehow, I created a template using Settings > Template Package, and selecting Data Model (the package I named my data model; pretty inventive  ;D).  It took a  template from a table (I'm guessing the table that was selected at the time) and used that?