on 2012 Mar 07 5:12 AM
This question is just out of curiosity, fyi, for this application it makes no difference if I used short or byte, but I wanted to ask anyway.
When mapping a tinyint
column to a byte
property of an entity, I get this exception: Dialect does not support DbType.Byte
. I'm using SA12.0.1 and NHibernate 3.1 with Glenn Paulley's dialect. I haven't upgraded to NH3.2 yet since FluentNH didn't catch up yet.
If I use a property of type short
, it's ok, no complaints. In the documentation for tinyint
, it's also stated that "Also, to send a TINYINT value to a database from an application written in C, the type of the C variable should be integer."
Since both SA tinyint
and .Net byte
are unsigned types ranging 0-255, why would not the former be assigned to the latter?
Request clarification before answering.
I think the problem is simply that the mapping of BYTE
to TINYINT
isn't present in my dialect - an oversight on my part.
If you want that specific mapping, you can add the line
RegisterColumnType(DbType.Byte, "TINYINT");
to the RegisterNumericTypeMappings()
routine yourself, and then recompile the NHibernate DLL with Visual Studio.
I will submit this to the NHibernate forum as a bug, so that it can be corrected in a subsequent NHibernate distribution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for taking the time. As a note to future readers, I managed to get it working without recompiling NH by adding the line you mentioned to SybaseSQLAnywhere12Dialect class constructor.
User | Count |
---|---|
81 | |
30 | |
10 | |
8 | |
8 | |
7 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.