Book a Demo

Author Topic: MDG - finding "base" object type from MDG metaclass  (Read 4268 times)

ejafman

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
MDG - finding "base" object type from MDG metaclass
« on: June 16, 2022, 08:47:33 am »
Hi all...we're thinking of implementing a simple ("?") MDG to add some extensions to elements.

In my testing, I noticed that when I create a class based on the metaclass in the MDG, it's object type on t_objects changed to the stereotype name used.

Is there any way to query t_objects, joining to some other table, which can give me the base class that the object type is an extension of? Searched almost every table, and didn't find anything.

Thanks in advance...Eric

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: MDG - finding "base" object type from MDG metaclass
« Reply #1 on: June 16, 2022, 11:04:14 am »
The base type can be found in t_object.Object_type.
However I understand your confusion because if you do a query such as
Code: [Select]
Select * from t_objectfrom Sparx EA SQL Scratch Pad you'll find the results are modified slightly and you see the stereotype in the object_type field.

However if you make your query a little more specific and run a query like this one below you get the correct value in object_type
Code: [Select]
SELECT t_object.name, t_object.Object_Type, t_object.Stereotype from t_object where t_object.stereotype like 'Application Component'
If you use an eapx file you can open it with MS Access and see the true contents of fields too.

Don't ask me why that behaviour occurs as I no idea, just a fellow user whose observed that behaviour.
Happy to help
:)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: MDG - finding "base" object type from MDG metaclass
« Reply #2 on: June 16, 2022, 11:40:54 am »
Don't ask me why that behaviour occurs as I no idea, just a fellow user whose observed that behaviour.
Because most users of a model need information on what the intention of the model is, not how it's stored. That's true even if the search that's being run is written in sql.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: MDG - finding "base" object type from MDG metaclass
« Reply #3 on: June 16, 2022, 02:04:27 pm »
The trick to getting the actual value is using an alias.
The translation magic EA is doing is based on the name of the column.

Something like
select o.Object_Type as RealObjectType from t_object o

But it's a good idea anyways to write your queries in a proper SQL editor.
That will avoid the translation, and it will provide you with code completion (which EA only does on the most basic level, not when using aliases)

Geert

ejafman

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: MDG - finding "base" object type from MDG metaclass
« Reply #4 on: June 16, 2022, 08:22:51 pm »
Thanks all...great news.

Of course, I asked the question prior to running it through my SQL  tool; assumed that the output via the search, I ran exact SQL that Sunshine mentioned. I mean, why would anything on the result set change (joking).

Eric