SELECT i.NAME as name, COUNT(m.ID) as nbMethods
FROM INTERFACE i, METHOD m
WHERE m.TYPE_ID = i.ID GROUP BY i.ID HAVING COUNT(m.ID) > 20;
I'm thinking about how I would best discover these tables as a new user. And I'd probably expect METHOD.DECLARING_CLASS to be the value to use for the join with INTERFACE., not TYPE_ID.
A method has several "types", e.g. annotations, return types, exception types, parameter types, type arguments, etc. So I wouldn't use a generic TYPE_ID to model the declaring class.
I do agree, without documentation, TYPE_ID can be confusing (BTW, I've added a description of the model here). The column name should be more explicit, something like DECLARING_TYPE_ID.
Seeing this example statment here:
I'm thinking about how I would best discover these tables as a new user. And I'd probably expect
METHOD.DECLARING_CLASS
to be the value to use for the join withINTERFACE.
, notTYPE_ID
.A method has several "types", e.g. annotations, return types, exception types, parameter types, type arguments, etc. So I wouldn't use a generic
TYPE_ID
to model the declaring class.