An element may contain any number of diagrams, but only one of them can be the composite diagram.
In fact, you can move the composite diagram out of the element and place it somewhere else - it will still be the composite diagram. Don't do this, it really messes up your model. I'm only mentioning it for completeness.
The t_object
table has a magic column NType
, whose interpretation depends on the element type. "Compositeness" is represented by the number 8 in this column. This is not documented, but not likely to change.
So a query to find all composite elements might look like
select ea_guid as CLASSGUID, Object_Type as CLASSTYPE, Name
from t_object where NType=8
ea_guid as CLASSGUID
is the trick that allows you to right-click the search result and look it up in the browser (or in diagrams), Object_Type as CLASSTYPE
presents the correct icon for each result. Not necessary, but looks nice.
And of course you can add other columns such as Object_Type
(which would show the type as a string), Stereotype
, etc.