Columns - Nulliable and Not Null

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Columns - Nulliable and Not Null

Post by RobertK » Thu 01 Jun 2017 06:50

Imagehttps://ibb.co/hUNUOF

You have "Nullable" which means the value can be null. BUT then you have "Not Null" now what is this? is this a duplicate feature of the same thing?

EDIT: Nullable is for the class, and "Not Null" is for the database table? shouldn't there just be one option?

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

Re: Columns - Nulliable and Not Null

Post by Shalex » Tue 06 Jun 2017 11:33

RobertK wrote:Nullable is for the class, and "Not Null" is for the database table?
That is correct.
RobertK wrote:shouldn't there just be one option?
These are two different options by design: one is for class property, another one is for database column.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Columns - Nulliable and Not Null

Post by RobertK » Wed 21 Jun 2017 01:18

Shalex wrote:
RobertK wrote:Nullable is for the class, and "Not Null" is for the database table?
That is correct.
RobertK wrote:shouldn't there just be one option?
These are two different options by design: one is for class property, another one is for database column.
It should provide a warning that the two dont match because it makes no sense for it not to match?

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

Re: Columns - Nulliable and Not Null

Post by Shalex » Thu 29 Jun 2017 15:42

"Nullable" and "Not Null" are two conceptually different settings.

"Nullable" defines behavior of a model class property.

Column's "Not Null" attribute is taken into account in the following cases:
* generating DDL of the column when using Generate Database Script From Model
* comparing storage part of the model and database itself in Update Model From Database / Update Database From Model wizards

By default, Entity Developer should synchronize values of "Nullable" and "Not Null".

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: Columns - Nulliable and Not Null

Post by RobertK » Wed 12 Jul 2017 01:14

Shalex wrote:"Nullable" and "Not Null" are two conceptually different settings.

By default, Entity Developer should synchronize values of "Nullable" and "Not Null".
Entity Developer should sync the two values nullable and not null - however, it does not do this!
hence the reason for reporting this issue.

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

Re: Columns - Nulliable and Not Null

Post by Shalex » Thu 13 Jul 2017 18:06

Possible values:
* Nullable -> true, false
* Not Null -> "not set", true, false

Synchronization works when Not Null is "not set". Otherwise, the exact value (true or false) means that a user defined the value of Not Null himself and Entity Developer should not override it.

If this doesn't help, please specify the exact steps we should follow to reproduce the issue when default values "Nullable" and "Not Null" do not match. For example: create the following table in database [...], add it to the model, check values of "Nullable" and "Not Null", they should be [...] but actually they are [...].

Post Reply