Database column field type is 'bit' - what is NHibernate type equivalent?

1,083 views
Skip to first unread message

Billy Stack

unread,
Aug 18, 2009, 11:29:55 AM8/18/09
to nhu...@googlegroups.com
Hi all,

I have a database column that is of type "bit"

What is the NHibernate type equivalent?

i.e.

<property name="IsValid" column="IsValid" type="What type is used here" />

Cheers,
Billy

Oskar Berggren

unread,
Aug 18, 2009, 11:39:13 AM8/18/09
to nhu...@googlegroups.com
bool comes to mind.

/Oskar


2009/8/18 Billy Stack <bs.s...@gmail.com>:

Fabio Maulo

unread,
Aug 18, 2009, 11:57:54 AM8/18/09
to nhu...@googlegroups.com
"Boolean" or even better 
<property name="IsValid"/>
That's all.

2009/8/18 Billy Stack <bs.s...@gmail.com>



--
Fabio Maulo

Fabio Maulo

unread,
Aug 18, 2009, 12:02:10 PM8/18/09
to nhu...@googlegroups.com
The rule of thumbs of mapping is:
don't try to be clear, specify only what NH does not know by convention.

The convention is simple: 
- The column has the same name of the property.
- The type is defined by the default for the System.Type of the property
- String len is 255
- precision/scale: 18,5

Now map only by difference.

2009/8/18 Fabio Maulo <fabio...@gmail.com>



--
Fabio Maulo

Billy Stack

unread,
Aug 19, 2009, 3:57:25 AM8/19/09
to nhu...@googlegroups.com
Cheers Fabio
Reply all
Reply to author
Forward
0 new messages