Can I tell if a property is dirty using nhibernate?

前端 未结 1 510
失恋的感觉
失恋的感觉 2020-12-09 15:04

Does anyone know if it is possible to tell if a specific property on an object is dirty (i.e. the property is different to the one stored on the DB) using NHibernate?

<
相关标签:
1条回答
  • 2020-12-09 16:05

    That is not currently available through the nHibernate (or Hibnernate, AFAIK) API. You could write something like this yourself by storing the state of the objects when they're loaded into session, then compare them.

    NOTE: I haven't seen this for myself, but, if you haven't locked into an ORM choice, you should look at Subsonic. A lot of the dirty status is tracked within the objects themselves, and you'd be able to determine if a particular property is dirty.

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