Spring hibernatetemplate saveorupdate not updating

This mapping file will be used by Hibernate perform Object-Relational Mapping between Person class and PERSON table.Create Person Dao class (see sample code below) which represents the Data Access Object which will interact with the database.This class extends from Hibernate Dao Support (see line 8 below).

Create Person Service class (see sample code below), a Service class which contains reference to Person Dao (see line 7 below).Create add Person() and fetch All Persons() methods which delegate the call to Person Dao (see lines 17-23 below). This class is used only to create the necessary PERSON table in the database.We will create the Db Util class with members as data Source.Finally, we will test our setup using Test Spring Hibernate Dao Support class which will load Spring context and get a reference to Person Service class.The configuration properties include the hibernate mapping resources, hibernate properties and a datasource.

The Session Factory can handle both pure hibernate session management with single database or transactions that span multiple databases using JTA .The dependency injection chart for the spring-config is as follows: In particular, note how hibernate mapping file is declared within Spring (see lines 31-35 below).Also note how Hibernate specific properties are declared within Spring (see lines 36-41 below).Create members data Source (see line 11 below) Create accessor methods for data Source (see lines 13-19 below).Create the initialize method and execute the ‘CREATE TABLE’ statement to create the PERSON table (see lines 21-32) Create the file (see XML configuration below).Hibernate Template that helps in accessing the database via hibernate.