developing logic for handling updates for hibernate