Page 1 of 1

Nullable generated NHibernate mapping properties

Posted: Tue 02 Oct 2012 16:23
by boxcar
Hi, if I set some properties in my class to not be nullable, and then generate the NHibernate mapping, the generated properties in the .hbm.xml file doesn't have not-null="true" set. I can get the not-null="true" in the mappings if I explicitly set the Not Null option in the Column Editor.

Is there a setting somewhere to get the generated mapping to use the properties' Nullable flag instead of having to edit all my columns in the Column Editor? Thanks!

Re: Nullable generated NHibernate mapping properties

Posted: Fri 05 Oct 2012 11:59
by Shalex
Here is an extract from Entity Developer documentation concerning the Not Null column property in Column Editor:
if selected, specifies that the column should be non-nullable. If the value of the Not Null check box is not specified explicitly, i.e. is not checked or unchecked, its value will be calculated depending on the Nullable property value of the corresponding property.
We have reproduced the following behaviour:
Nullable=false
Not Null=unspecified
=> there is no not-null="true" in the *.hbm.xml file.

We will post here when the issue is fixed.

Re: Nullable generated NHibernate mapping properties

Posted: Fri 05 Oct 2012 16:39
by Shalex
The bug with generating the Not Null column attribute in the xml-mapping file basing on the Nullable property is fixed. We will post here when the corresponding build of Entity Developer is available for download.

Re: Nullable generated NHibernate mapping properties

Posted: Fri 05 Oct 2012 17:52
by boxcar
Great! Thank you for looking into it.

Re: Nullable generated NHibernate mapping properties

Posted: Thu 18 Oct 2012 16:15
by Shalex
New build of Entity Developer 4.7.285 is available for download!
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://forums.devart.com/viewtopic.php?f=32&t=25093.