In my application I have a bool property named DisplayIndicator. In the database (DB2) it’s correspondence is DISPL_IND column of type smallint.
The correspondence is the following:
[DisplayINdicator=True, DISPL_IND=1] and
[DisplayINdicator=False, DISPL_IND=0]
Is it possible to map using nhibernate fluence the bool property to smallint?
In my application I have a bool property named DisplayIndicator. In the database (DB2)
Share
I figured it out, after Frans’s advise.
I created a class that represents nhibernate user type used to map boolean type to short type:
public class BooleanAsShortType : IUserType
To the mapping, I added a CustomType property and now it looks like this:
Map(x => x.DisplayIndicator, “DSPL_IND”).CustomType< BooleanAsShortType >();