Book a Demo

Author Topic: Search for object_type gives strange results  (Read 3201 times)

ducatiross

  • EA User
  • **
  • Posts: 114
  • Karma: +1/-0
    • View Profile
Search for object_type gives strange results
« on: November 19, 2014, 01:54:46 am »
Hi

I wanted to use the Standard search facility to find all instances of a DataObject element I had created. However, regardless of what I used in the builder I could not find one.

I then resorted to writing some SQL :-

select object_ID, Object_type, Name, stereotype
from t_object
where stereotype = 'DataObject'

and this found a number of objects, but it proved that the Object_Type was 'Artifact', not DataObject.

Furthermore, when the results are displayed in the result window, it displays the Object_type column as 'DataObject' even when it is actually an 'Artifact' !

Using this SQL :-

select object_ID, Object_type, Name, stereotype
from t_object
where stereotype = 'DataObject'
and Object_type = 'Artifact'

I get this as the first row

object_ID,Object_type,Name,stereotype,
814,DataObject,CRM4 XML File,DataObject,

Why does it do this ?
Are there any other objects that have a misleading Object_Type ?

Matthew


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Search for object_type gives strange results
« Reply #1 on: November 19, 2014, 02:46:05 am »
Some elements have different type in the table than presented in the API or GUI. It has been discussed here. I don't remember the reasons (claim it for history if you like) but that's as it is.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Search for object_type gives strange results
« Reply #2 on: November 19, 2014, 08:40:11 am »
In this case the explanation is simpler.

The SQL search window doesn't just display the results in the database. Object_Type is one of the columns with special handling. It shows the localized type, and in the case of stereotypes with _metatype set it shows that instead of the UML type that the stereotype applies to.

The easy solution is to change your SQL.

Select Object_Type as Real_Type from t_object
« Last Edit: November 19, 2014, 08:41:33 am by simonm »