nhibernate - Multiple row update in nhibenrate -


So I was wondering if to use a HQL query to update multiple rows in a database object. I know the answer is HQL query but please give me enough reason for this. But the disadvantages of using a HQ query like my API are difficult dependencies on the model. If the name of the property changes in HV, I clearly remember the existence of this query.

If yes, please set the quantity.

Thank you. Awaiting Your Answer

If you declare your HQL update statement as a named query, NHibernate will validate it When this session creates a factory and if there is an error then it will be thrown. So if you ever change the property name and forget to change the HQL, then it will throw at the start of you (i.e. fast fail), so that it can be quite safe.

Loading and saving each object individually affects IMO, I always try to do my databases whenever possible.


Comments