Forum Stats

  • 3,733,004 Users
  • 2,246,671 Discussions
  • 7,856,461 Comments

Discussions

Naming of Foreign Key Constraint

Robert Huber
Robert Huber Member Posts: 180 Blue Ribbon

I have the following situation for a Supertype/Subtype entity, as seen in the attached screenshot. It is translated as Table per Child.

As a result, I get for the constraint names for the "based on" relationship names as expected "profile_probation_promotion_based_on_fk", and "profile_period_promotion_based_on_fk"

For the 3 remaining relationships, bound to the Supertype, I get

"profile_promotion_defined_by_fk", "profile_promotion_lined_up_on_by_fk", and "profile_promotion_bount_to_fk".

As it is a Table per Child implementation, where there is not table profile_promotions, I would like to get the 3 foreign keys to be named starting with

"profile_probation_promotion_defined_by_fk", ...

and "profile_period_promotion_defined_by_fk", ...

With this, because these leds to 2 constraints having the same name, it is avoided that one of these constraints gets the _fkv1 ending.

Is this possible?

Thanks a lot, Robert


Answers

  • Günter
    Günter Member Posts: 102 Bronze Badge

    Can't you override in the "Foreign Key Properties" the generated Names ?

    Regards Günter

  • Robert Huber
    Robert Huber Member Posts: 180 Blue Ribbon

    Do you mean just after generation of the child tables manually overwrite the fk constraint name? Yes, I can do that.

    But I am wondering if I can somewhere set that so at generating the child tables (from Supertype/Supbtype) they get the desired names.

    Regards, Robert

  • Günter
    Günter Member Posts: 102 Bronze Badge
    edited May 7

    In the Desing Level Settings\Settings\Naming Standard\Templates you can define your own standards which are used for the generated names.

    Regards Günter

  • Robert Huber
    Robert Huber Member Posts: 180 Blue Ribbon

    Thanks. I use my defined settings in Level Settings > Settings > Naming Standard > Templates. The problem arises from the the chosen implementation for a Supertype/Subtype Entity. Only at this time it's known by the ODM if it's a -child table, Single table, etc. implementation. And in the template is only one definition line, for example for the form of a constraint. And this one line does not fit more than one (dynamically) created implementation.

    Hope I could clarify a bit what I try to achieve.

    Regards, Robert

Sign In or Register to comment.