NHibernate update on single property updates all properties in sql

后端 未结 2 1465
青春惊慌失措
青春惊慌失措 2021-02-13 13:19

I am performing a standard update in NHibernate to a single property. However on commit of the transaction the sql update seems to set all fields I have mapped on the table even

2条回答
  •  囚心锁ツ
    2021-02-13 14:01

    Well. yes this is normal behaviour for NHibernate. You can use generated attribute for your properties to change the behaviour. Details on Ayende's blog.

    Why is this default is because with dynamics you don't get your query plan cached. And usually you don't mind that you send few more bytes over high speed network connection between your application server and database. Unless you are saving long strings where this setting is perfectly appropriate.

提交回复
热议问题