This is part of a series of posts about NHibernate Pitfalls. See the entire collection here.
If you want to map large string columns (SQL Server’s VARCHAR(max)/NVARCHAR(max), Oracle’s CLOB/NCLOB) to NHibernate properties, you must specify the StringClobType. This is because the default mapping type for string columns, StringType, does not support large strings (>4000 characters).
If you also want to generate the database from the model, you should also specify the native column type. For SQL Server:
And for Oracle:
Of course, the .NET class remains the same, whatever the underlying NHibernate mapping type is: