Book a Demo

Author Topic: help! do some query "complex"using the A  (Read 3428 times)

iwt2

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
help! do some query "complex"using the A
« on: July 30, 2010, 08:42:05 pm »
Hello,

I need some help. I am using API EA 8.0 to make a Java application.

Previously, I accessed the eap file using jdbc and SQL querys. the problem is that I don't know  how to do some query "complex" using the API methods. Also, I do not want to use SQL query.

For example, the query:

SELECT * FROM t_object Where Stereotype like  'xxx' AND object_type like 'class';

How I can get the elements t_object using only the methods of the API?

Thank you very muchjunto
« Last Edit: July 31, 2010, 12:38:09 am by iwt2 »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: help! do some query "complex"using the API met
« Reply #1 on: July 30, 2010, 09:55:56 pm »
Use Repository.GetElementSet?

Actually most of the API is build to start from a specific object, and access other objects through there relations, nested elements etc...
When you need all classes that have a certain stereotype then the only 'real' option is to use a query somehow.
You could of course also start from the top level package, and recurse all subpackages and their elements, but that is incredibly slow, even on moderate size models.

Geert

iwt2

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: help! do some query "complex"using the API met
« Reply #2 on: July 31, 2010, 12:36:18 am »
Thanks for your response.

Finally I solved the problem by combining the methods GetElementsByQuery and AddDefinedSearches  :)