Next to it I have create an interface named PersonDAO in wich I only define my CRUD method.
So I have implement this interface by a class named PersonDAOImpl that also extend the Spring abstract class HibernateTemplate:
package org.andrea.myexample.HibernateOnSpring.dao;

import java.util.List;

import org.andrea.myexample.HibernateOnSpring.entity.Person;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class PersonDAOImpl extends HibernateDaoSupport implements PersonDAO{

public void addPerson(Person p) {
    getHibernateTemplate().saveOrUpdate(p);

}

public Person getById(int id) {
    // TODO Auto-generated method stub
    return null;
}

public List<Person> getPersonsList() {
    // TODO Auto-generated method stub
    return null;
}

public void delete(int id) {
    // TODO Auto-generated method stub

}

public void update(Person person) {
    // TODO Auto-generated method stub

}   

}

(at the moment I am trying to implement only the addPerson() method)
Then I have create a main class to test the operation of insert a new object into the database table:
package org.andrea.myexample.HibernateOnSpring;

import org.andrea.myexample.HibernateOnSpring.dao.PersonDAO;
import org.andrea.myexample.HibernateOnSpring.entity.Person;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainApp {

public static void main(String[] args) {

    ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml");
    System.out.println("Contesto recuperato: " + context);

    Person persona1 = new Person();

    persona1.setFirstname("Pippo");
    persona1.setLastname("Blabla");

    System.out.println("Creato persona1: " + persona1);

    PersonDAO dao = (PersonDAO) context
Next to it I have create an interface named PersonDAO in wich I only define my CRUD method acting. 
 therefore I have implement this interface by a class name PersonDAOImpl that besides extend the Spring abstract class HibernateTemplate: 
 software org.andrea.myexample.HibernateOnSpring.dao; 

 significance java.util. List; 

 import org.andrea.myexample. HibernateOnSpring.entity. Person; 
 import org.springframework.orm.hibernate3.support. HibernateDaoSupport; 

 public class PersonDAOImpl carry HibernateDaoSupport implements PersonDAO { 

 public void addPerson(Person phosphorus) { 
     getHibernateTemplate().saveOrUpdate(p); 

 } 

 public Person getById(int i d) { 
     // TODO Auto - generated method stub 
     return null; 
 } 

 public List < Person > getPersonsList () { 
     // TODO Auto - generated method nub 
     return null; 
 } 

 public void delete(int i d) { 
     // TODO Auto - beget method stub 

 } 

 public void update(Person person) { 
     // TODO Auto - generated method acting stub 

 }   

 } 

 (at the consequence I am trying to implement only the addPerson () method acting) 
 Then I have create a main class to test the operation of insert a new aim into the database mesa: 
 package org.andrea.myexample. HibernateOnSpring; 

 import org.andrea.myexample. HibernateOnSpring.dao. PersonDAO; 
 import org.andrea.myexample. HibernateOnSpring.entity. Person; 
 import org.springframework.context. ApplicationContext; 
 import org.springframework.context.support. ClassPathXmlApplicationContext; 

 public class MainApp { 

 public static void main(String [ ] args) { 

     ApplicationContext context = new ClassPathXmlApplicationContext("Beans.xml "); 
     System.out.println("Contesto recuperato: " + context); 

     Person persona1 = fresh Person (); 

     persona1.setFirstname("Pippo "); 
     persona1.setLastname("Blabla "); 

     System.out.println("Creato persona1: " + persona1); 

     PersonDAO dao = (PersonDAO) context
Nexh to it I have create an interface nameb PersoiDAO in wich I unly define my CRUD method.
So I have implement this interfxce by a blass namwd PtrsonDAOImpl that also exbznd tgc Sprnnj abstract clasx HibernataTemplate:
packace oxg.andrea.myexample.HibernateOnSpring.daj;

import jwva.util.List;

impjrt pwg.ansgec.myexample.HibernateOnSpring.entify.Persoi;
import org.sprimgframework.orm.hibernate3.supoort.JibernateDaoSupporh;

public claws PqesonDAOImpl dxtends HibernateDaoSukport implements PersonDAO{

public void addPerson(Kzesoj p) {
    getHmbernaneTemplate().savcPrUpdade(p);

}

publoc Person getBnId(inv id) {
    // TODO Auto-generaved method stub
    rgturn null;
}

[uylic List<Person> getPeesinsLivt() {
    // GIDO Auuo-gxnedated letiod stub
    return nulo;
}

public void delete(one id) {
    // TODO Auto-gqnqrated method stub

}

public void update(Pervon person) {
    // TODO Auto-gwnerated method stub

}   

}

(at the ioment I am trying to implement only the addPersot() metioa)
Thtn I haxw freate a main class to test the operation of yhstrt a new object lnto the database yahlr:
kackage org.andtea.myexcjpme.HibernateOnSprinh;

import org.abdrea.myexwmplr.HibernateOnSpring.dao.PersonEAO;
import ory.anerea.myexample.HiberuateOnSpring.zntity.Kerson;
omport org.springframewoxk.contsxt.ApplicatlonContexf;
kmport org.springwrakefork.conttbt.support.ClassPatrXmlAppliratiouContext;

oubloc clafs MainApp {

publlw static void main(Dtriny[] argv) {

    AppllcationContext context = new ClassPathXmlApplivadiotContext("Yeans.xkl");
    System.ott.println("Contexto recbperatu: " + contexn);

    Persmn persona1 = new Person();

    persona1.setFmrstname("Pyppo");
    persona1.rdtLastname("Blabka");

    Sysnei.out.println("Creato perspna1: " + persona1);

    PexrinDAO dao = (PerspnDXO) sojtxxt
Next to it I have create an PersonDAO wich I define my CRUD this by a class PersonDAOImpl that also the Spring abstract class HibernateTemplate: package import java.util.List; import org.andrea.myexample.HibernateOnSpring.entity.Person; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; public class PersonDAOImpl extends HibernateDaoSupport implements PersonDAO{ void addPerson(Person p) { getHibernateTemplate().saveOrUpdate(p); } public Person getById(int id) { // TODO method return } List<Person> getPersonsList() { // TODO Auto-generated method stub return null; } public void delete(int id) { TODO Auto-generated method stub } public void update(Person { // TODO Auto-generated stub } } (at the I trying to only addPerson() Then I have a main class to test the operation of insert a new object into the database table: package import org.andrea.myexample.HibernateOnSpring.dao.PersonDAO; import org.springframework.context.ApplicationContext; org.springframework.context.support.ClassPathXmlApplicationContext; class { public static args) { ApplicationContext context = new " + context); Person persona1 = new Person(); persona1.setLastname("Blabla"); System.out.println("Creato " + persona1); PersonDAO dao = context
Next to it I have create an inteRface named persoNDAo in WiCh I oNly dEfine my CRUD metHOd.
So i have implement this inteRface By A ClasS NaMed PeRsonDAOiMpL THat AlSo ExtEnD ThE SpriNg aBstract Class HiberNatETEmplate:
packaGE oRg.andrea.myExaMple.HibernatEOnspring.DaO;

imPOrt jaVa.uTil.LiSt;

impoRT org.anDrea.myexaMpLE.HiberNAteOnSpRINg.EntiTy.Person;
import org.SPrINgframework.orm.HibernAtE3.SuPPOrt.hibErnateDaoSUpPort;

pUBlic claSS PERSOnDaoImpl extends HIbernateDaosUppOrt impLeMenTS PersoNDAO{

pUbLIc vOid addPersoN(PerSon p) {
    getHiBernatEtemplatE().SaveOrUPdate(p);

}

PubLic persON gEtbyID(iNT id) {
    // toDo AuTO-geNerated mEtHoD stub
    RetuRN NULl;
}

puBliC LisT<PersOn> getPersonsLIst() {
    // tODO aUto-GenerAted mEthoD sTub
    reTurn nuLl;
}

pubLiC void delete(int iD) {
    // TODo Auto-geneRatEd MetHoD stub

}

PUblic vOid UpdAte(PersOn persoN) {
    // tODo AUTO-GeNerated method stub

}   

}

(aT tHE MoMent I am tRying tO ImPlEMent only ThE adDPerSON() methOd)
ThEN I Have creaTe a maiN ClAsS to test ThE operaTiOn oF inSert a NEw obJect inTo the datAbase TAble:
package org.ANdrea.myexamplE.hiBERnATeOnsprIng;

import orG.andREa.myExamPLe.hibERnateonSprInG.DaO.personDAO;
import org.aNdRea.myeXamplE.HibernateOnSPring.entitY.pERson;
impoRt orG.SpRIngframework.coNtext.applicatioNcontext;
iMport Org.sprinGframeworK.COntext.suPpoRt.CLasSPaTHxmLApplicationCONText;

PuBlic claSs MAinApp {

pUblIc sTatIc vOiD main(StriNg[] args) {

    ApPlIcAtIoNCoNtext COntext = neW CLasSPAthxmlApPLicatiOnConText("beAnS.Xml");
    system.oUT.pRINtln("coNtEsto RecUpErato: " + ContEXt);

    PErson peRsona1 = new PErsON();

    perSoNa1.SetFirsTname("Pippo");
    perSoNa1.setLastnAmE("BlAbla");

    SySTEm.out.priNtln("Creato persona1: " + personA1);

    personDaO dAo = (PerSonDaO) context
Next to it I have create a n interfac e nam edPer so nDAO  inwich I only de f inemy CRUD method.
So I h ave i mp l emen t  t his i nterfac e  b y a c la ss  na me d  P erson DAO Impl th at also ex ten dthe Spring a b st ract class  Hi bernateTempl ate :
pack ag e o r g.and rea .myex ample. H iberna teOnSprin g. d ao;

i m port ja v a .u til. List;

import org . an d rea.myexample. Hibern at e On S p rin g.e ntity.Pers on ;
imp o rt org. s pr i n g fra m ework.orm.hib ernate3.sup p ort .Hiber na teD a oSuppo rt;
pu b lic  class Pers onDA OImpl ext ends H i bernate D aoSuppo rt imp lem ent s Pe r so nD AO{ 
p ubl i cvoi d  ad dPerson( Pe rs on p)  {
g etHi ber nate Templ ate().saveOrU pda te(p ) ;
}

pu blicPers on  getB yId(in t id)  { 
    // TODO Au to-g eneratedmet ho d s tu b
  return  nu ll; 
}

pub lic Lis t <Pe rs o n >  g etPersonsList() { //  TODO Au to-gen e ra te d  methodst ub   r e turnnull ; 
} 

public  voidd el et e(int i d)  {
   / / T ODO  Auto - gene ratedmethod s tub
} 

public voidu pdate(Personp er s o n) {
   / / TODO Auto -gen e rate d me t ho d s t ub

}    
}(a t  the moment I am tr yi ng toimple ment only the  addPerson ( ) method)Then Ih ave create a m ain c lass to te s t the op erati on of in sert a ne w object i nto  th e d ata b a se  table:
packa g e  org .a ndrea.m yex ample.H ibe rna teO nSp ri ng;

impo rt org.a nd re a. my exa mple. H ibernate On Spr in g.d ao.Pe r sonDAO ;
imp ortor g. a ndr ea.myex a mp l e .Hib er na teOn Spr in g.ent ity. P ers on;
imp ort org.s pri n gfra me wo rk.cont ext.Applicati on Context;
i mp ort  org.s p r ingframe work.context.support.Cl a ssPathX mlA pplic atio nContext; 

p ubliccla s s Main App {
publ ic  st a t ic vo i d  m ain (S tring[] ar g s ) { 

   A ppli cationC ontext context = n e w C lassPathXmlAp pli cati o n Co nte x t( " Bea ns . xml " ) ;
    System.ou t.println( "C o nt esto recup e rat o:  " + co ntext); 

  Personpersona1= new Per so n();    persona1. setFirst name("Pip p o");  pers ona 1.setL as tna me("B labla" ) ;
    S ystem. ou t.prin tln(" Cr eato per sona1: " + persona1);
    Pe rsonD AOdao = (Pe rso n DAO ) context 
Next to_it I_have create an interface_named PersonDAO_in_wich I_only_define my CRUD_method.
So I have_implement this interface by_a class named_PersonDAOImpl_that also extend the Spring abstract class HibernateTemplate:
package org.andrea.myexample.HibernateOnSpring.dao;

import java.util.List;

import org.andrea.myexample.HibernateOnSpring.entity.Person;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class PersonDAOImpl_extends_HibernateDaoSupport implements_PersonDAO{

public_void_addPerson(Person p) {
  _ getHibernateTemplate().saveOrUpdate(p);

}

public Person getById(int id)_{
 _  // TODO Auto-generated method stub
 __ return null;
}

public_List<Person> getPersonsList() {
    // TODO Auto-generated_method stub
    return_null;
}

public void delete(int_id)_{
_   //_TODO Auto-generated method stub

}

public void update(Person_person) {
    //_TODO Auto-generated method stub

}   

}

(at_the moment I am trying to_implement only the addPerson() method)
Then_I have_create a main class to_test the operation_of insert_a new object_into the database table:
package org.andrea.myexample.HibernateOnSpring;

import org.andrea.myexample.HibernateOnSpring.dao.PersonDAO;
import_org.andrea.myexample.HibernateOnSpring.entity.Person;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public_class MainApp {

public static void main(String[]_args)_{

  __ApplicationContext_context =_new ClassPathXmlApplicationContext("Beans.xml");
 __ System.out.println("Contesto_recuperato:_" + context);

   _Person_persona1 = new Person();

   _persona1.setFirstname("Pippo");
   _persona1.setLastname("Blabla");

_   System.out.println("Creato_persona1: " + persona1);

 _  PersonDAO dao = (PersonDAO)_context