How to store a non truncated varchar(max) string with NHibernate and Fluent NHibernate

前端 未结 3 1925
南旧
南旧 2021-02-07 05:19

My DB schema has a string as a varchar(max). I have read the other questions concerning setting Length to more than 4000 or 8000 so that it really generates a (n)varchar(max) in

相关标签:
3条回答
  • 2021-02-07 05:49

    DanP's link is broken. The updated link is:

    http://www.primordialcode.com/blog/post/nhibernate-prepare_sql-considerations-mapping-long-string-fields

    0 讨论(0)
  • 2021-02-07 05:55

    This mapping should work:

    <property name="TheProperty" type="StringClob">
      <column name="TheColumn" sql-type="nvarchar(max)" />
    </property>
    

    Just look for the fluent equivalent.

    0 讨论(0)
  • 2021-02-07 05:59

    It would appear that this is an old problem which is now resurfacing in NHibernate 3.x builds; you can read about the workarounds here.

    Note: I have updated the original link I posted as it was outdated.

    0 讨论(0)
提交回复
热议问题