Look into versioning and optimistic or pessimistic locking, in the
NHibernate reference manual, to resolve concurrent update attempts.

For behavior of setting comment only if not already set, I would probably
consider that to be business logic that should be handled above NHibernate.

/Oskar
Den 26 maj 2016 10:35 fm skrev "rachita behera" <behera.rach...@gmail.com>:

> how to update table in fluentnhibernate with a where clause?
>
> Ex: Let's say I have a table customer with 3 fields: ID,name,comment.
> Customer can give comment which will be saved to "comment" column. There is
> another instance where system is trying to update the customer data by
> entering id, name, and system generated comment. At this time if the same
> customer is already having comments given, then that field should not
> update,else all data should be updated.
>
> I know about mapping class, where if we mark a field as ".Not.Update()",
> the field will not be updated at all. But in this case I need the field to
> be updated only when it is empty.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fluent-nhibernate+unsubscr...@googlegroups.com.
> To post to this group, send email to fluent-nhibernate@googlegroups.com.
> Visit this group at https://groups.google.com/group/fluent-nhibernate.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at https://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/d/optout.

Reply via email to