Binary boolean vs. fuzzy nullable boolean

Hi,

I have the following problem:

I have a class member of a boolean type. It maps to a field of “bit” type (MS SQL Server). Values of the field can be (“yet unknown” value - business requirement).

Code generated for C# contains a class member that is of “bool” type. When I retrieve an object form a database, null values of boolean database are interpreted as false, and when I save an object they change to 0 (false) in the database.

This is against business requirements.

What is best practise in solving this kind of problems?

Cheers,
Tadeusz

Hello Tadeusz,

I regret that we were unable to support your request currently because NHibernate does not support nullable type officially until version 1.2.

Sorry about this.

Best regards,
Jick

Hi,

I am also very interested in this issue.

Is there no way to implement an enumeration? (something like true/false/undefined or yes/no/undefined)

And will VP ever support NHibernate 1.2 and nullable types?

Kind regards,
Mark

hello Mark,

I just discussed with our developers. We will support your need later on. I will inform you once it is available.

Best regards,
Jick

Hello Mark,

We have completed the support of Enumeration. This will be available in the next release. Do you want to try? If so, please let me know your email address and I will arrange an early access for you.

To prevent spam, I suggest you not to post your email address here. You may send me a private message.

Best regards,
Jick

Hello Mark,

Enumeration support is ready in Service Pack 2. Therefore, I suggest you run the product updater inside %VP-Suite-Install-Dir%/bin to advance to the latest release. Please feel free to let me know if there are any questions.

Best regards,
Jick