Feature 2 – updating the details of an employee
Next feature we are going to implement is updating details of an employee. Possible updates to an employee entity could be changes to properties such as first name, last name, and so on, or addition or removal of one or more benefits or communities. Remember that all updates work in almost the same way so it is more important to understand how updates work than what is being updated.
NHibernate offers multiple different mechanisms for making changes to persistent entities. Before we look into actual implementation of modification of an employee record, I want to spend some time discussing two important concepts that dictate how this feature could be implemented. Clarity around these two concepts should help you determine which mechanism you can use to update entities:
Partial updates versus full updates: When you want to change values of some of the properties on a persistent entity, then that will need a partial update. An example of this would...