Book a Demo

Author Topic: Relating Table Columns to Associations  (Read 47231 times)

Nigel_Simpson

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Relating Table Columns to Associations
« on: May 11, 2021, 01:55:34 am »
In the feature matrix or a diagram, I can create a link between a table column and a class attribute that it realises. However, some attributes are implicit, such as associations. When I use the DDL transform, these implicit attributes are created as columns and a transform connector is created under the covers (I believe).
1. Is there a way for me to create a visible connector from an existing table column to an association/aggregation/composition between two classes to indicate that the column realises that relation?
2. I can see in the t_connector table that the feature matrix creates one connector for each attribute/column combination I link using the feature matrix, but I can't see how to find the attribute and column names that are at the connector ends - where is that? I'd like to show it in my documentation using a SQL fragment.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Relating Table Columns to Associations
« Reply #1 on: May 11, 2021, 04:03:51 am »
We map columns to attributes and associations using the EA Mapping add-in.
https://bellekens.com/ea-mapping/

It's not visible on diagrams since we use tagged values, but very easy to query and report in an SQL fragment.

Geert

Nigel_Simpson

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Relating Table Columns to Associations
« Reply #2 on: May 11, 2021, 07:23:22 pm »
Thank Geert, that's helpful and I will try your add-in on my own copy of EA but I will not be able to modify the EA installation in my client's copy so unfortunately that won't work for me. Does anyone know a native EA way to do this, even if it is less straightforward than EA toolpack? I'd still like to know where EA records which features are connected by a connector using the feature matrix, and how the DDL transformer maps a column to an association.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Relating Table Columns to Associations
« Reply #3 on: June 11, 2021, 07:23:06 pm »
There are various ways out-of-the-box ways around this.

You could create as many relationships between classes as you need with the source and target columns specified in the role and make them visible in specialised "mapping" diagram. There is no restriction on the number of relationships you can have between 2 classes or the number of relationships that can be shown in a diagram. By the way, the source and target columns can be selected from 2 dropdown lists in the Role(s) section of the relationship properties dialog. This approach does only allow 1-to-1 mappings.

You could create an MDG with a custom Map/Transform stereotype and use it to as an intermediate element to map the attributes to different classes. This approach should allow you to document many-to-many mappings.


Nigel_Simpson

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Relating Table Columns to Associations
« Reply #4 on: June 13, 2021, 06:42:38 am »
Thanks very much for the suggestions. However, I would really like to be able to map columns back to relations and not classes or attributes, since the attributes represented by the column do not exist in the model except as associations, and I'd rather not modify my logical model (e.g. by converting all relations to attributes) just so I can map one particular physical model to it.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relating Table Columns to Associations
« Reply #5 on: June 13, 2021, 08:24:19 am »
Not sure if that helps, but connectors have a Connect to Element Feature next to each end in the context menu. That allows to make visible links to Attributes (aka columns) in diagrams.

q.

Nigel_Simpson

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Relating Table Columns to Associations
« Reply #6 on: June 13, 2021, 09:29:16 pm »
Thanks very much. I have found a way to model exactly what I want, although it's not straightforward. I discovered that I can start a realisation connector from an association connector and target a table column, then reverse the direction of that connector so the column now realises the association. Here is an example diagram of what I want:

On the diagram, that is exactly what I want, but my remaining problem is how to get that model as text in a document with the description of each realisation e.g.
"Column CLUB_MEMBER.MEMBER_ID realises attribute Club Member (Member ID)
...
Column CLUB_MEMBER.CLUB_ID realises association Club Member member of Club
..."
I can see the realisation connectors in t_connector and I know there is a proxy connector object involved in the linkages now, and that t_xref might have some part to play, but I can't see how to join t_connector, t_object and t_attribute to get the above text for my documentation. Can anyone help with the SQL?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relating Table Columns to Associations
« Reply #7 on: June 14, 2021, 04:56:43 am »
I doubt you can do that with SQL. The connector has CSV data in StyleEx with LFEP= and LFSP= holding the guids of the connected attributes.

q.

Richard Freggi

  • EA User
  • **
  • Posts: 498
  • Karma: +18/-7
    • View Profile
Re: Relating Table Columns to Associations
« Reply #8 on: August 28, 2021, 01:22:56 pm »
Thanks very much. I have found a way to model exactly what I want, although it's not straightforward. I discovered that I can start a realisation connector from an association connector and target a table column, then reverse the direction of that connector so the column now realises the association. Here is an example diagram of what I want:

On the diagram, that is exactly what I want, but my remaining problem is how to get that model as text in a document with the description of each realisation e.g.
"Column CLUB_MEMBER.MEMBER_ID realises attribute Club Member (Member ID)
...
Column CLUB_MEMBER.CLUB_ID realises association Club Member member of Club
..."
I can see the realisation connectors in t_connector and I know there is a proxy connector object involved in the linkages now, and that t_xref might have some part to play, but I can't see how to join t_connector, t_object and t_attribute to get the above text for my documentation. Can anyone help with the SQL?

The IDEA plugin provides an excellent GUI to do this (it's free, in the Sparx plugin web page).  I use Geert's EA mapping because I don't need the diagrams, it's excellent!