Book a Demo

Author Topic: Always Suppress Foreign Keys labels on DB Diagrams  (Read 3861 times)

msisson

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Always Suppress Foreign Keys labels on DB Diagrams
« on: July 16, 2008, 08:05:50 am »
How can I set the default behavior of all my database diagrams so that when I drop two tables on the diagram it only shows the one label the shows my two fields from the two tables?  I don't want to see a label at either end of the relationship line that shows the foreign key or primary keys involved in the relationship.

Thx

msisson

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Always Suppress Foreign Keys labels on DB Diag
« Reply #1 on: July 16, 2008, 08:08:10 am »
Sorry - a little more info.  The only way that I find I'm able to alter the display of relationship between two table is to right-click on the relationship, clikc on Visibility, and then choose Label Visibility.  Then I have to laborious go through all the available labels and uncheck the ones I don't want to see.  This is a HUGE pain to do on every single relationship that I have on all my database diagrams.

I'm sure there's an easy way!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Always Suppress Foreign Keys labels on DB Diag
« Reply #2 on: July 16, 2008, 08:25:34 am »
Sadly, I think you've got the picture.

Some 'sticky' means to set default label visibility used to be a frequently requested feature. AFAIK we still don't have this yet.

Before you take my word on this, try setting the visibility of labels the way you've done to date. Now see if new labels take the new visibility settings. I don't think they do, but it is worth checking.

My guess is that we've all given up on this one. Perhaps you'd like to make a new feature request; that might finally add the necessary weight to get this on onto the queue for an update.

You'll find the necessary request form by clicking the Feature request link under the Support link near the bottom of any forum page.

Meanwhile, you could write a short add-in to solve this problem. If you're not comfortable with writing EA add-ins there is a work-around. Try building a small data model with only two key associations. Now change the labels on one of them to the way you prefer.

Export the whole package to XMI. Using your favorite editor (XML-aware or not) locate the two associations. Note that you might need to look up the diagram links that reference the associations. Take a look at how the labels are described in the XML file.

Now try exporting the package trees from (a copy of) your project. Use a text editor to modify the label visibility. You should be able to accelerate the process a great deal - how much depends on your editor - compared to doing this in EA. You can then import your XMI back into your project copy. With luck you might be able to automate some or all of this process in your editor. [You should play with the diagram image settings to see what works best. My guess is that you won't need to include them.]

HTH, David
No, you can't have it!

msisson

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Always Suppress Foreign Keys labels on DB Diag
« Reply #3 on: July 16, 2008, 09:31:54 am »
Hey Midnight, thx for the quick reply.  Sure, I'll add my two cents to the request pile.

You mentioned that an authored add-in would do the trick.  I haven't done any add-in authoring but I'm certainly not adverse to it.  So what would be the general mechanism that the add-in would do here?  Would I intercept some sort of event like "BeforeCreateAssociationLine" that I could plug into and make my own drawing decision?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Always Suppress Foreign Keys labels on DB Diag
« Reply #4 on: July 16, 2008, 11:54:58 am »
I suppose you could do it that way, but unless you really need real-time response there are easier ways.

Perhaps you can create a simple automation application that opens you project, tweaks all the diagrams, saves the results and then exits. That would probably be easier, and would be a lot less front-end work.

You could always come back and write the 'internal' add-in. If you design your code well you should get a lot of reuse.

Another approach would be to simply read the database fields directly and make the appropriate edits. You'll need to play around a bit here, but it is easy once you get the hang of it. The trouble with this approach is that the fields involved contain 'magic' values that are undocumented. [This is why I am not going into details.] These could change at any time.

David
No, you can't have it!

msisson

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Always Suppress Foreign Keys labels on DB Diag
« Reply #5 on: July 17, 2008, 01:24:36 am »
Gotcha.  Do you think I'd find enough hooks in the scripting language/api to put have a macro that I could run at any time on the current diagram that would fix the lines?

(BTW, thx for answering my questions that I could probably lookup on line.  I just don't have the time currently to start digging in)