I am using NHibernate against a legacy database which uses Char column types (fixed Strings). I am mapping the char columns to strings in properties. Currently my criteria queries are failing if the value against which i am querying is not padded with spaces such that the length of the string is equal to the char column length. I dont want to manually pad in this way for all values. I was kind of looking that NHibernate will take care of this for me.
I tried the mapping with the following options:
<property name="Account">
<column name="Account" sql-type="char(9)" length="9"/>
</property>
and
<property name="Account" type="AnsiChar">
<column name="Account"/>
</property>
The first has no affect and the problem with the second mapping is that it assumes that the property type should be of type System.Char and not string. I am looking for a mapping where i can map Oracle's Char data type to normal string.