Author Topic: More info on GetElementsByQuery  (Read 4492 times)

sandeep bhat

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
    • View Profile
More info on GetElementsByQuery
« on: November 15, 2014, 01:01:15 am »
Hi,
There is this method from the Repository Class GetElementsByQuery (string QueryName, string SearchTerm).

i want to find an Element object with its name 'sint16'.
By default this query- GetElementsByQuery ("Simple", "sint16") returns a collection witth the string sint16 contained in either name or notes. I want to filter this query only if it matches the name.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: More info on GetElementsByQuery
« Reply #1 on: November 15, 2014, 06:40:22 am »
You could write your own SQL search:
Code: [Select]
SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE,t_object.Name FROM t_object WHERE Name = "<Search Term>"
q.

sandeep bhat

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
    • View Profile
Re: More info on GetElementsByQuery
« Reply #2 on: November 17, 2014, 06:59:16 pm »
Thanks q, by  the way is the Enterprise Architect Database accessible? Any location where it is saved?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: More info on GetElementsByQuery
« Reply #3 on: November 17, 2014, 07:47:27 pm »
Yes. Use Repository.SQLQuery("SELECT...") (see the help). You might also be interested in my Inside book (link below).

q.

sandeep bhat

  • EA User
  • **
  • Posts: 36
  • Karma: +0/-0
    • View Profile
Re: More info on GetElementsByQuery
« Reply #4 on: November 17, 2014, 08:52:03 pm »
Yes, i will definitely have a look at it. Thanks again q.