Nullable generated NHibernate mapping properties

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
boxcar
Posts: 2
Joined: Tue 02 Oct 2012 16:13

Nullable generated NHibernate mapping properties

Post by boxcar » Tue 02 Oct 2012 16:23

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!

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

Re: Nullable generated NHibernate mapping properties

Post by Shalex » Fri 05 Oct 2012 11:59

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.

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

Re: Nullable generated NHibernate mapping properties

Post by Shalex » Fri 05 Oct 2012 16:39

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.

boxcar
Posts: 2
Joined: Tue 02 Oct 2012 16:13

Re: Nullable generated NHibernate mapping properties

Post by boxcar » Fri 05 Oct 2012 17:52

Great! Thank you for looking into it.

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

Re: Nullable generated NHibernate mapping properties

Post by Shalex » Thu 18 Oct 2012 16:15

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.

Post Reply