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

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Schulz_GdvKuhn
Posts: 7
Joined: Fri 01 Jun 2018 10:52

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

Post by Schulz_GdvKuhn » Thu 13 Aug 2020 14:52

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

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

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

Post by Shalex » Fri 14 Aug 2020 14:30

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.

Schulz_GdvKuhn
Posts: 7
Joined: Fri 01 Jun 2018 10:52

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

Post by Schulz_GdvKuhn » Tue 18 Aug 2020 13:23

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

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

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

Post by Shalex » Thu 20 Aug 2020 19:12

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.

Post Reply