How can be Association "ZeroOrOne-To-Many" created?

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
gr8user
Posts: 16
Joined: Wed 24 Aug 2016 23:45

How can be Association "ZeroOrOne-To-Many" created?

Post by gr8user » Fri 26 Aug 2016 20:19

Hi,

What should be set up to get association "ZeroOrOne-To-May"?

According Help file "In case all foreign key columns of the details table are nullable, the association will have the zero-or-one to many type, which means that the detail class navigation property referring to the master class can be NULL."

Where and how can I achieve that? Whatever I'm trying to do, I get "One-To-Many" association and foreign key columns of the details table are NOT nullable.

I compared 2 examples from your 50 samples - and couldn't find any differences between associations for "one-to-many" and "ZeroOrOne-to-many."

gr8user
Posts: 16
Joined: Wed 24 Aug 2016 23:45

Re: How can be Association "ZeroOrOne-To-Many" created?

Post by gr8user » Fri 26 Aug 2016 21:23

Actually I have found way to create foreign key columns to be nullable. But I can see problem here.
In the property tab for foreign key columns in GENERAL part there are no lines for:
Type
Nullable

Type is inherited from primary key of master table, but I cannot see it as property or foreign key column.

I think it is a bug.

There are no different graphic presentation for association itself with nullable foreign key and no displayed property "Nullable" in Property tab for foreign key columns.

In other data modeler applications associations with nullable foreign key columns displayed differently.
It helps a lot when you simply working with diagrams to understand what is going on .

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How can be Association "ZeroOrOne-To-Many" created?

Post by Shalex » Mon 29 Aug 2016 17:07

1. Are you using the Entity Framework (*.edml) model? Or is it Entity Framework Core (*.efml) or NHibernate (*.hbml) or Telerik Data Access (*.daml) or LinqConnect (*.lqml)?

2. Refer to http://www.devart.com/entitydeveloper/e ... eloper.chm (right click > Properties > Unblock), open the ORM Support node > choose your ORM > Concepts > Working with Associations > One to Many Association.

If this doesn't help, send us a test model and specify the exact steps we should follow for reproducing the issue.

gr8user
Posts: 16
Joined: Wed 24 Aug 2016 23:45

Re: How can be Association "ZeroOrOne-To-Many" created?

Post by gr8user » Tue 30 Aug 2016 17:19

Hi Shalex,
Thank you for reply. I was asking about "In the property tab for foreign key columns in GENERAL part there are no lines for: Type, Nullable
Type is inherited from primary key of master table, but I cannot see it as property or foreign key column."
I'm working on NHibernate (*.hbml)

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How can be Association "ZeroOrOne-To-Many" created?

Post by Shalex » Thu 01 Sep 2016 16:27

gr8user wrote:I was asking about "In the property tab for foreign key columns in GENERAL part there are no lines for: Type, Nullable
Type is inherited from primary key of master table, but I cannot see it as property or foreign key column."
I'm working on NHibernate (*.hbml)
The case is not clear. Please send us a test model and specify the exact steps we should follow for reproducing the issue.

Post Reply