Blog‎ > ‎Articoli‎ > ‎

Query di ricerca per Enterprise Architect (Sparx Systems)

pubblicato 4 set 2015, 03:50 da Rudy Azzan   [ aggiornato in data 24 apr 2017, 10:33 ]

Effort per package selezionato

SELECT DISTINCT t_object.ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, t_object.Name AS Object, t_objecteffort.Effort, t_objecteffort.EffortType, t_objecteffort.EValue, t_objecteffort.Notes
FROM 
t_object, t_objecteffort, t_package

WHERE
t_package.Package_id in (#Branch#)
AND t_object.Package_ID = t_package.Package_ID
AND t_object.Object_ID = t_objecteffort.Object_ID
AND t_object.Status <> 'Implemented'

Visualizzazione ore totali di effort

SELECT SUM( t_objecteffort.EValue) as Hours
FROM 
t_object, t_objecteffort, t_package

WHERE
t_package.Package_id in (#Branch#)
AND t_object.Package_ID = t_package.Package_ID
AND t_object.Object_ID = t_objecteffort.Object_ID
AND t_object.Status <> 'Implemented'

Tutti i test falliti

SELECT t_object.Name as [Element], t_object.Author, t_objecttests.Test, t_objecttests.Status, t_objecttests.TestType, t_objecttests.RunBy, t_objecttests.CheckBy, t_objecttests.DateRun, t_objecttests.TestClass,  't_objecttests' as CLASSTABLE, t_objecttests.Object_ID
FROM t_objecttests, t_object
WHERE 
t_objecttests.Status = 'Fail' AND
t_objecttests.Object_ID = t_object.Object_ID 

ORDER BY
 t_objecttests.DateRun ASC

Classi senza descrizione

SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type as CLASSTYPE, t_object.Name, t_object.Note as Notes
FROM t_object
WHERE Object_Type='Class' AND GenFile IS NULL

Proprietà e metodi senza commenti

SELECT t_operation.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name, t_operation.Name as Op FROM t_object, t_operation
WHERE t_object.Object_Type='Class' AND t_operation.Notes  IS Null AND t_operation.Object_ID = t_object.Object_ID
order by t_object.Name, t_operation.Name

Trova tutti gli elementi orfani

select distinct o.ea_guid as CLASSGUID,o.Object_Type as CLASSTYPE,o.Name as Name, o.Stereotype,
package.name as PackageName ,package_p1.name as PackageLevel1,package_p2.name as PackageLevel2 ,package_p3.name as PackageLevel3 
from ((((((((((((((((( t_object o
left join t_diagramobjects dob on dob.[Object_ID] = o.[Object_ID])
left join t_object inst on inst.[Classifier] = o.[Object_ID])
left join t_objectproperties otv on otv.VALUE = o.[ea_guid])
left join t_connectortag ctv on ctv.VALUE = o.[ea_guid])
left join t_attributetag atv on atv.VALUE = o.[ea_guid])
left join t_operationtag optv on optv.VALUE = o.[ea_guid])
left join t_object u on u.Pdata1 = o.ea_guid)
left join t_connector cs on cs.Start_Object_ID = o.Object_ID)
left join t_connector ce on ce.End_Object_ID = o.Object_ID)
left join t_attribute att on att.Classifier like o.Object_ID)
left join t_operation op on op.Classifier like o.Object_ID)
left join t_operationparams opp on opp.Classifier like o.Object_ID)
left join t_object owned on owned.ParentID = o.Object_ID)
inner join t_package package on o.package_id = package.package_id) 
left join t_package package_p1 on package_p1.package_id = package.parent_id) 
left join t_package package_p2 on package_p2.package_id = package_p1.parent_id) 
left join t_package package_p3 on package_p3.package_id = package_p2.parent_id) 
where
o.Package_ID in (#Branch#)
and (o.name is null or o.Name like '#WC#<Search Term>#WC#')
and o.Object_Type not in ('Package')
and (o.Stereotype is null or o.Stereotype not in ('model document'))
and dob.Object_ID is null
and inst.Object_ID is null
and otv.VALUE is null
and ctv.Value is null
and atv.Value is null
and optv.Value is null
and u.Object_ID is null
and cs.Start_Object_ID is null
and ce.End_Object_ID is null
and att.Classifier is null
and op.Classifier is null
and opp.Classifier is null
and owned.Object_ID is null

Pre e post condizioni sui metodi

SELECT DISTINCT t_operation.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE,
t_object.Name, t_operation.Name as Op,
t_operationpres.Type, t_operationpres.PreCondition as Condition
FROM t_object, t_operation, t_operationpres, t_package
WHERE 
t_package.Package_id in (#Branch#)
AND t_object.Package_ID = t_package.Package_ID
AND t_operation.Object_ID = t_object.Object_ID
AND t_operation.OperationID = t_operationpres.OperationID
AND t_object.Object_Type='Class'
AND not t_operationpres.PreCondition IS Null
UNION
SELECT DISTINCT t_operation.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE,
t_object.Name, t_operation.Name as Op,
t_operationposts.Type, t_operationposts.PostCondition as Condition
FROM t_object, t_operation, t_operationposts, t_package
WHERE 
t_package.Package_id in (#Branch#)
AND t_object.Package_ID = t_package.Package_ID
AND t_operation.Object_ID = t_object.Object_ID
AND t_operation.OperationID = t_operationposts.OperationID
AND t_object.Object_Type='Class'
AND not t_operationposts.PostCondition IS Null
order by 3,4,5 desc

Pre e post condizioni sui metodi, con tag custom idTest

Il tag custom idTest, lo ho inserito, per trovare velocemente tutti i metodi per cui ho implementato il relativo unit test
SELECT DISTINCT t_operation.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE,
t_object.Name, t_operation.Name as Op,
t_operationpres.Type, t_operationpres.PreCondition as Condition
FROM t_object, t_operation, t_operationpres, t_package, t_operationtag
WHERE 
t_package.Package_id in (#Branch#)
AND t_object.Package_ID = t_package.Package_ID
AND t_operation.Object_ID = t_object.Object_ID
AND t_operation.OperationID = t_operationpres.OperationID
AND t_object.Object_Type='Class'
AND not t_operationpres.PreCondition IS Null
AND t_operationtag.Property ='idTest'
AND t_operationtag.ElementID = t_operation.OperationID
AND t_operationtag.VALUE IS Null
UNION
SELECT DISTINCT t_operation.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE,
t_object.Name, t_operation.Name as Op,
t_operationposts.Type, t_operationposts.PostCondition as Condition
FROM t_object, t_operation, t_operationposts, t_package, t_operationtag
WHERE 
t_package.Package_id in (#Branch#)
AND t_object.Package_ID = t_package.Package_ID
AND t_operation.Object_ID = t_object.Object_ID
AND t_operation.OperationID = t_operationposts.OperationID
AND t_object.Object_Type='Class'
AND not t_operationposts.PostCondition IS Null
AND t_operationtag.Property ='idTest'
AND t_operationtag.ElementID = t_operation.OperationID
AND t_operationtag.VALUE IS Null
order by 3,4,5 desc
Comments