Page 1 of 1

Not Null (Default True) but Not.Nullable() not set

Posted: Thu 13 Aug 2020 14:52
by Schulz_GdvKuhn
Hello everybody,

When i add a property and do not set Nullable in Property Editor, then in the Column Editor there is Not Null (Default: True). But in the mapping (made by Fluent NHibernate Template), the Not.Nullable() for that property ist not set.

Image
Image
Image

In the template there is:

Code: Select all

<#+
            if (column.NotNull.HasValue && column.NotNull.Value) { #>

        .Not.Nullable()<#+
            }
        #>
Where is the condition about the default value or the HibernateProperty.Nullable?

What do i missing? Is it a configuration error, an error in the template or a bug in Entity Developer?

Kind Regards
Michael

Re: Not Null (Default True) but Not.Nullable() not set

Posted: Fri 14 Aug 2020 14:30
by Shalex
There are three possible values for Not Null in Column Editor:
* checked
* unchecked
* not specified (not checked or unchecked)

It is "not specified" value on your screenshot (black square).

Refer to https://www.devart.com/entitydeveloper/ ... ditor.html.

Re: Not Null (Default True) but Not.Nullable() not set

Posted: Tue 18 Aug 2020 13:23
by Schulz_GdvKuhn
Hello Shalex,

thanks for the reply. I tried to verify that by creating a new Model with Fluent NHibernate Template, but the generated Database script and the generated Fluent Mapping doesn't match:

Generated database script
Image

Generated (wrong) fluent mapping
Image

Correct fluent mapping
Image

That's why I asked, how to access the default value or the HibernateProperty.Nullable from template.

Kind Regards
Michael

Re: Not Null (Default True) but Not.Nullable() not set

Posted: Thu 20 Aug 2020 19:12
by Shalex
Schulz_GdvKuhn wrote: Tue 18 Aug 2020 13:23 the generated Database script and the generated Fluent Mapping doesn't match
They match settings from screenshots in your first post in this thread:
Property Editor (for fluent mapping) -> Nullable=False
Column Editor (for database script) -> Not Null=not set (Default: True)

If this doesn't explain current behavior, please send us a test model, describe current behavior and the expected one.