Smallest type instead of largest possible

27 views
Skip to first unread message

Oskar Berggren

unread,
Aug 1, 2016, 12:11:51 PM8/1/16
to nhibernate-...@googlegroups.com
If TypeNames.Get(...., size, ...) can't find a large enough type registered by the dialect, it will return the default type. At least for strings, this is typically to be a rather small type, and certainly smaller than what is actually possible.

Seems like it would be more useful to return the largest known type instead. Or even raise an error to force the developer to make a usable choice in the mapping.

For example, on MSSQL this has the weird effect of:
  a) mapped length = Int32.MaxValue/2 => nvarchar(max)
but
  b) mapped length = Int32.MaxValue/2 +1 => nvarchar(255)
/Oskar
Reply all
Reply to author
Forward
0 new messages