Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Daleb

Pages: [1]
1
Thanks for the tip, I'll check out the link  :)

I've written my own little c# utility to do the same thing and it works well enough for me, but Tangible Architect might be better in the long run.

2
Automation Interface, Add-Ins and Tools / Generate code from tables?
« on: March 20, 2005, 06:32:23 pm »
Has anyone generated C# code from table elements?
I want to maintain the logical model, but I don't want to maintain two sets of objects (for those with a persistent implementation) just so that I can generate code and ddl when database changes occur.
Alternatively has anyone generated the data model from the logical model?
Alternatively, is there a way to set up a custom stereotype so that an entity knows it has a persistent implementation?

3
Does anyone have an example of creating a primary key through the automation interface?
I can create a primary key operation that looks fine in EA, but I can't seem to get the key columns to appear, or get marked as a PK in the column list.

Here is what I've got so far -

       // add a primary key (for some reason EA calls this an operation/method)
       method = (EA.Method) table.Methods.AddNew("PrimaryKey", "PK");
       method.Stereotype = "PK";

       foreach(EA.Attribute column in table.Attributes)
       {
         if (column.Stereotype.Equals("PK"))
         {
           parameter = (EA.Parameter) method.Parameters.AddNew(column.Name, "Parameter");
           parameter.Kind = "in";
           parameter.Type = "int";

           parameter.Update();
         }
         method.Parameters.Refresh();
         method.Update();
       }
       table.Methods.Refresh();
       table.Update();

Pages: [1]