7186
Automation Interface, Add-Ins and Tools / Re: reverse code with far keyword
« on: July 13, 2011, 07:00:30 pm »
you can't.
Geert
Geert
The forum has been updated!
Pro Cloud Server Released!
Enterprise Architect 13.5 Released!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
/// <summary>
/// search the model using an sql query
/// </summary>
/// <param name="SQLQuery">the query to be performed</param>
/// <param name="searchTerm">the searchterm to be looked for</param>
/// <returns>a list of EA wrappers matching the required criteria</returns>
private List<object> SearchSQL(string SQLQuery,string searchTerm)
{
List<object> searchResults = new List<object>();
// add the searchTerm in the query
SQLQuery = SQLQuery.Replace("<Search Term>", searchTerm);
string searchResult = wrappedModel.SQLQuery(SQLQuery);
//parse string (xml format) to find out which objects are returned
List<string> guids = XMLParser.getTagValues(searchResult, "CLASSGUID");
List<string> types = XMLParser.getTagValues(searchResult, "CLASSTYPE");
for (int i = 0; i < guids.Count; i++)
{
object objectToBeWrapped = null;
if (types[i] == "Attribute")
{
objectToBeWrapped = wrappedModel.GetAttributeByGuid(guids[i]);
}
else if (types[i] == "Connector")
{
objectToBeWrapped = wrappedModel.GetConnectorByGuid(guids[i]);
}
else if (types[i] == "Operation")
{
objectToBeWrapped = wrappedModel.GetMethodByGuid(guids[i]);
}
else if (types[i] == "Diagram")
{
objectToBeWrapped = wrappedModel.GetDiagramByGuid(guids[i]);
}
else
//must be an element then
{
objectToBeWrapped = wrappedModel.GetElementByGuid(guids[i]);
}
if (objectToBeWrapped != null)
{
searchResults.Add(EAWrapperFactory.createEAWrapper(this, objectToBeWrapped));
}
}
return searchResults;
}
select * from t_object o
where o.pdata4 like '2143504841'
select * from t_object o
where o.pdata4 like '<connector_ID>'
select * from t_object o
join t_connector c on cast (cast(o.pdata4 as nvarchar(max))as int) = c.connector_id
where o.name like 'AssociationClassName'