Author Topic: Attribute/Column lengths from Logical to Physical Data Model  (Read 4610 times)

Arun8006

  • EA Novice
  • *
  • Posts: 8
  • Karma: +1/-0
    • View Profile
Attribute/Column lengths from Logical to Physical Data Model
« on: February 07, 2024, 02:49:25 pm »
Hi All,
In logical class model I have defined attributes and they do not have option to define the lengths.
For example, if my class name is Employee and EmployeeName is the attribute defined as VARCHAR, I don't see option to define the length say 100 Characters wide in logical model. I have defined the default database (SQL Server in my case) which has default lengths for each applicable datatypes. for example 50 for varchar, 10 for char, etc.
When I convert the Logical model to Physical, all the varchar attributes are converted to columns in the table as expected, but all are defaulted to a standard size 50.
My question is: Can I define attribute size in logical models? If the answer is NO, then I can define size in converted physical model but how to avoid the size getting overwritten next time?

Regards,
Arun

shimon

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Re: Attribute/Column lengths from Logical to Physical Data Model
« Reply #1 on: February 07, 2024, 04:56:47 pm »
Hi Arun,
We used EA to model a DB2 DB. We did not use Entities, but regular classes. We did not use the DDL creation ability of EA, either. I think we tested it and found it missing so key information, but this was over 10 years ago, so I can't be sure.

In order to define the length ( and if the attribute / column was NULLABLE) we used tagged values.

The names were len ( with the value a int).

For nullable we used two tagged values named, NULL=TRUE and NULL=FALSE. In the value field I always entered a period. If the value was left NULL, we had difficulty using it (reading it) in the Addins.

Sincerely,
Shimon

P.S. We did develop an addin to create DDL's from these fields, but it was never used as the DBA choose to use a different tool for this purpose.
 

Arun8006

  • EA Novice
  • *
  • Posts: 8
  • Karma: +1/-0
    • View Profile
Re: Attribute/Column lengths from Logical to Physical Data Model
« Reply #2 on: February 21, 2024, 01:12:51 pm »
Thanks Shimon, for your reply.

I kind of worked out on a workaround. I converted a class to a table (and set the DB to SQL Server). Once the class is converted to table, the attributes start to show the lengths and other properties like NULLable too. Defined the lengths and also the NULLABLE property. Once the attribute's properties are set, convert the table back to class.
Even after conversion EA still holds this information which is abstracted.
During physical model transformation, once these classes are transformed into tables, the columns of the tables are created with the lengths as defined in the class's attribute length.
 

shimon

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Re: Attribute/Column lengths from Logical to Physical Data Model
« Reply #3 on: February 21, 2024, 04:55:28 pm »
Hi,
That's a great idea.
Just a question, are these attributes visible in any way? For us this was important to be able to go back and look how they were defined.
I guess you could define a custom search, but changing the values ( as they surely will, over time) is a little cumbersome if you have change the Type back and forth every time.

Sincerely,
Shimon