Toad World® Forums

Mandatory Cardinality Question


#1

If I create a relationship between table1 to table2 and make it mandatory on parent and mandatory on child, it does not make the foreign key on child as not null. My assumption is that the the foreign key would need to be not null since it is mandatory, isn’t it?

On the latest beta (3.1.3.56), if I go to the child table and force the foreign key to be not null, it changes the cardinality and unmarks ‘Mandatory Parent’. This does not happen latest released version (3.0.13.175). Which one is right?

This is all with Physical model and SQL Server 2005.

Thanks!!!


#2

Hello,

My assumption is that the the foreign key would need to be not null since it is mandatory, isn’t it?

FK attribute NN has no connection with child mandatory but only with parent mandatory.

On the latest beta (3.1.3.56), if I go to the child table and force the foreign key to be not null, it changes the cardinality and unmarks ‘Mandatory Parent’. This does not happen latest released version (3.0.13.175). Which one is right?

It is not correct in latest Beta and in official version 3.0.13 either. It’s been fixed for next TDM3 release. Thanks for your notification!

Regards,

Vladka


#3

Hi there,

Sorry to bump this thread, but it describes the same thing that I am experiencing.

Using TDM 3.3.7.22, if I create table1 and table2 and link them through a non identifying relation with Mandatory ticked for the parent (1…1 to 0…n), the corresponding generated model (PostGre 8.2, but I check a few others as well) shows the FK without the NN attribute.

If I edit the relation in the physical model, Mandatory parent is ticked. If I uncheck it and check it again and click apply, this time the NN attributes is set.

It seems like it is not set at conversion time as it should.

Kind regards,
Manny


#4

Hi Manny,

Unfortunately, I keep failing to simulate the problem.

Here is what I do:

  1. I select Settings | Options | Physical Model | Synchronize NotNull with Mandatory Parent checkbox is selected. - Do you have the same?
  2. I create two entities, parent with a PK attribute. (PG 8.2 model)
  3. I add a non-identifying relationship.
  4. I open the Relationship Properties dialog and the Entity Properties form of child entity | Attributes tab - both dialogs at the same time.
  5. In the Relationship Properties dialog, I select the Mandatory Parent checkbox and click Apply.
  6. As soon as I click Apply, NotNull checkbox is automatically selected for the FK attribute in child entity.
    So, it seems to work fine for me.

If I understand well, NotNull of your FK attribute is not selected after you confirm Apply in the Relationship Properties dialog and you have to clear and select the Mandatory Parent checkbox of the relationship again. Is that right?

Please cofirm I take the same steps as you.
Also, please see what settings for the Synchronization you have set in Options. Thanks for the details.

P.S. Manny, if the problem remains, could you please send us the part of your model where it occurs? (to modeling@quest.com). Thanks very much.
Regards,

Vladka

Message was edited by: vladka - P.S. note


#5

Hi Vladka,

1 : checked the options, I have the same

Here is how to reproduce this :

  • Create a new logical model
  • Add 2 entities (entity1 and entity2)
  • For each entity : add a mandatory attribute (key1 and key2)
  • For each entity, define this attribute as a primary key
  • Create a non identifying relationship between entity1 and entity2
  • Leave everything as default (1…1 - 0…n)
  • convert the model to a physical model

You should have entity2 with a FK to key1 that is not showing the NN attribute

I can fix it by doing the following :

  • in the physical model, edit the relationship
  • uncheck mandatory parent
  • check it again
  • apply

Then the NN is showing up on my FK

Just to make this clear, this is the conversion from logical to physical model which shows the problem, all other functionnalities are ok.

Message was edited by: Manny
logical.jpeg


#6

Hi Vladka,

1 : checked the options, I have the same

Here is how to reproduce this :

  • Create a new logical model
  • Add 2 entities (entity1 and entity2)
  • For each entity : add a mandatory attribute (key1 and key2)
  • For each entity, define this attribute as a primary key
  • Create a non identifying relationship between entity1 and entity2
  • Leave everything as default (1…1 - 0…n)
  • convert the model to a physical model

You should have entity2 with a FK to key1 that is not showing the NN attribute

I can fix it by doing the following :

  • in the physical model, edit the relationship
  • uncheck mandatory parent
  • check it again
  • apply

Then the NN is showing up on my FK

Just to make this clear, this is the conversion from logical to physical model which shows the problem, all other functionnalities are ok.

Message was edited by: Manny
physical.jpeg


#7

Hello Manny,

Thanks for the detailed description. You are right, there is a bug - the problem occurs during LER to PER conversion. We will fix it. CR# 58 283.

Thanks very much for your fantastic co-operation!

Have a nice day.

Regards,

Vladka