sqlenterprise-architect

SQL, Link to Element Feature


I have two classes. One Attribut of class1 is connected to another attribut of class2. This was done with the help of the context menue of the connector in the proximity of one class, it is called Link to element feature. The same is done on the other side of the connector to select the other attribut of the other class. So the connector directly connects two attributes and not the classes itselves. I haven´t found the tables, where this infomation is stored, so I dont find the appropiate SQL to find connected (or not connected) attributes.


Solution

  • Here's the way for notes using Link to..

    First SQL:

    SELECT PDATA2 FROM t_object WHERE Object_Type='Note' AND PDATA1 = 'Attribute'
    

    will give you the ID. Just put that in another SQL:

    SELECT * FROM t_attribute WHERE ID = (above SQL)
    

    and you have the attribute details. Or if you want to find the unmapped one just build a dissection with the found IDs from the first with the existing attribute IDs.

    For associations using Link to... it's a bit more tricky. First off, any such connectors have the relevant information stored in t_connector.StyleEx like e.g.

    LFEP={69A30E17-23AB-4641-9573-9BDBAA988D52}L;
    

    LF<dir>P=<guid><pos>; connector is attached to attribute/operation <dir> = S or E meaning Start (source) or End (target) <guid> = ea_guid of t_attribute or t_operation

    <pos> is the edge (L or R) where the connector had been attached to in the moment when the link has been created. This is a superfluous information since the renderer will attach the link to whatever place is relevant.

    There can be one LFSP, one LFEP or both be present in one StyleEx property

    (from my Inside book)

    Now you can filter that information with a SQL or (what I prefer) with a little script, since doing complex SQL string operations are not my expertise.