Is there a way to find saved items when using SaveOrUpdate method in nhibernate?

StackOverflow https://stackoverflow.com/questions/9932289

  •  27-05-2021
  •  | 
  •  

Pregunta

Is there a way to find saved items when using SaveOrUpdate method in hibernate. Basically, I need to know if an item is just updated or it is actualy inserted within one session.

Thansk.

¿Fue útil?

Solución

Have a look at NHibernate interceptors.

Implementing NHibernate Interceptors

Interceptors

Otros consejos

When you are saving objects, as usual transient objects doesn't has an Id, and you can create a list with all processing objects which has an Id. Then you can iterate objects and find objects with new Id - they've been "saved".

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top