I need to map the ntext column of a table using mapping using a code function in NHibernate 3.2 so that it does not truncate to 4000 characters.
What can I change in the following example? "Notes" is a property that is of type ntext in the sql table:
Property (emp => emp.Notes);
Note. Please do not mix it with NHibernate or hbm free display.
So, I solved the problem as follows:
Property (emp => emp.Notes, map => map.Column (col => col.SqlType ("NTEXT")));
, , , : NHibernate mapper sql.:)
, jbl.
, , nvarchar (max):
Property(emp => emp.Notes, m => m.Type(NHibernateUtil.StringClob));
,
Try:
Property(emp => emp.Notes, mapinfo => mapinfo.Lenth(someHighValue));
If the provided length is longer than what varchar can fit, NHibernate will switch to a different type of character.