Page 1 of 2
"nullable" vs "not null" - duplication in the model spec?
Posted: Mon 19 Dec 2011 18:56
by mindplay
Properties have the "Nullable" setting under "General" - but under "Column" there is also a "Not Null" setting.
Isn't "Not Null" merely the opposite of "Nullable"? Why the need to configure and maintain this setting twice for every property/column-mapping?
If there is an edge-case where this is useful, perhaps the "Not Null" option could be empty by default? Using the opposite value of "Nullable" by default.
Posted: Fri 23 Dec 2011 08:34
by Shalex
The General tab in the Properties window defines behaviour of a model class property.
The Column tab 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
You may have a non-nullable class property for a nullable column in the database.
So, "Nullable" and "Not Null" are two conceptually different settings.
Posted: Fri 23 Dec 2011 15:00
by mindplay
Shalex wrote:So, "Nullable" and "Not Null" are two conceptually different settings.
Yes, but 98% of the time, one simply drives the other - which is why I'd suggest you make "Not Null" a Nullable, where NULL means use the default, e.g. !Nullable ... convention over configuration not only applies to code.
Posted: Tue 27 Dec 2011 17:31
by Shalex
Behaviour will be changed starting from the next build:
- the Validate Max Length attribute will be synchronized with the Length attribute of Column by default
- the Validate Required attribute will be synchronized with the Nullable attribute of Property by default
- implicit NOT NULL column's attribute in SQL script will be determined by the Nullable attribute of Property
We will post here when the corresponding build of Entity Developer is available for download.
Posted: Wed 28 Dec 2011 14:57
by mindplay
Fantastic, thank you!

Posted: Thu 12 Jan 2012 16:47
by Shalex
New build of Entity Developer 4.2.110 is available for download now!
It can be downloaded from
http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to
http://www.devart.com/forums/viewtopic.php?t=23135 .
Posted: Thu 19 Jan 2012 21:46
by mindplay
Looks like you introduced a bug here - it's now impossible to control the ValidateRequired property at all, it's being automatically reset anytime you close and reopen the model project.
I believe you meant to auto-set the ValidateRequired property only when someone changes the value from the property-sheet in the user-interface?
Otherwise you can't control the ValidateRequired property at all...
Posted: Tue 24 Jan 2012 10:35
by Shalex
mindplay wrote:it's now impossible to control the ValidateRequired property at all, it's being automatically reset anytime you close and reopen the model project
We have reproduced the bug. We will post here when it is fixed.
Posted: Tue 24 Jan 2012 17:00
by Shalex
The bug with resetting the Validate Required property after reopening model is fixed. We will post here when the corresponding build of Entity Developer is available for download.
Posted: Fri 27 Jan 2012 14:21
by Shalex
New build of Entity Developer 4.2.120 is available for download now!
It can be downloaded from
http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to
http://www.devart.com/forums/viewtopic.php?t=23252 .
Posted: Wed 01 Feb 2012 15:40
by mindplay
This problem still exists and was not fixed in this release.
Please send me an updated copy as soon as this issue has been resolved - I am currently completely stuck, since I already upgraded my project and integrated latest changes into my templates. Validation settings are changing on dozens of properties every time I open my project!
Posted: Thu 02 Feb 2012 12:45
by Shalex
We cannot reproduce the problem in our environment using Entity Developer v 4.2.120. Please
send us a small test model and specify the steps we should follow to reproduce the bug.
Posted: Thu 02 Feb 2012 14:18
by mindplay
Oddly, today I can't reproduce the problem anymore - not in the project that failed yesterday, and not in an isolated sample project either.
Perhaps rebooting my machine did something?
I'll let you know if this problem comes back...
Posted: Thu 02 Feb 2012 14:39
by mindplay
Okay, there is definitely still a problem.
It looks like the issue occurs while upgrading the project from a previous version - I repeated this a few times to make sure, reverting the previous version of the project files, then simply opening the project, changing a property name somewhere, and saving. Then comparing against the previous version.
Every component property was changed - before:
Code: Select all
<component class="MyApp.Entities.LocationFacility, MyApp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" p1:Guid="31ec8185-faaa-436b-b95b-fd01342507ea">
<property name="IndoorProductionSpace" type="Int32" p1:nullable="true" p1:Guid="0da5d7c2-c638-4242-bdb4-6cff6db0bcad">
<column name="" />
</property>
<property name="OutdoorProductionSpace" type="Int32" p1:nullable="true" p1:Guid="c978bb1b-e53c-4bf5-885d-0c867691bef0">
<column name="" />
</property>
<property name="IndoorStorageSpace" type="Int32" p1:nullable="true" p1:Guid="4e9c25ad-206e-4a80-820d-ef282cfda724">
<column name="" />
</property>
...
And after:
Code: Select all
<component class="MyApp.Entities.LocationFacility, MyApp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" p1:Guid="31ec8185-faaa-436b-b95b-fd01342507ea">
<property name="IndoorProductionSpace" type="Int32" p1:nullable="true" p1:ValidateRequired="True" p1:Guid="0da5d7c2-c638-4242-bdb4-6cff6db0bcad">
<column name="" />
</property>
<property name="OutdoorProductionSpace" type="Int32" p1:nullable="true" p1:ValidateRequired="True" p1:Guid="c978bb1b-e53c-4bf5-885d-0c867691bef0">
<column name="" />
</property>
<property name="IndoorStorageSpace" type="Int32" p1:nullable="true" p1:ValidateRequired="True" p1:Guid="4e9c25ad-206e-4a80-820d-ef282cfda724">
<column name="" />
</property>
...
As you can see, these were all Nullable=True, and now suddenly are also ValidateRequired=True. Looks like every individual property on every component now has ValidateRequired=True.
Many properties on classes have changed too - before:
Code: Select all
<property name="Active" type="Boolean" p1:Guid="d5c0e864-df33-421f-a00a-d359488abdca">
And after:
Code: Select all
<property name="Active" type="Boolean" p1:ValidateRequired="True" p1:Guid="d5c0e864-df33-421f-a00a-d359488abdca">
It looks like every property in the HBML file that did not have a ValidateRequired value, is now set to True.
288 properties were changed in my project just from opening and re-saving it.
You probably should check the version number of the EDPS file when opening, and if it's 4.2.110, initialize missing ValidateRequired properties when reading the HBML file, the way they were initialized by default in 4.2.110...
Posted: Fri 03 Feb 2012 14:23
by mindplay
Any ideas?