@Entity
@Table(name="ORDER")
public class Order {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="Order_no")
    private int _OrderNo;

    @Column(name="Customer_no")
    private int _CustomerNo;

    public Order() {

    }

    public Order(int CustomerNo) {

        this._CustomerNo = CustomerNo;
    }

    public int get_OrderNo() {
        return _OrderNo;
    }

    public void set_OrderNo(int OrderNo) {
        this._OrderNo = OrderNo;
    }

    public int get_CustomerNo() {
        return _CustomerNo;
    }

    public void set_CustomerNo(int CustomerNo) {
        this._CustomerNo = CustomerNo;
    }

    @Override
    public String toString() {
        return "Order [_OrderNo=" + _OrderNo + ",  _CustomerNo=" + _CustomerNo + "]";
    }

}  

this is my actual object saving file.
public class CreateOrder {

    public static void main(String[] args) {

        SessionFactory factory = new Configuration().configure("hibernate.cfg.xml").addAnnotatedClass(Order.class)
               .buildSessionFactory();

        Session session = factory.getCurrentSession();

        try {

            System.out.println("Creating the Order Object.......");

            Order tempOrder = new Order(123);

            session.beginTransaction();

            System.out.println("Saving the Order ");
            session.save(tempOrder);

            session.getTransaction().commit();
            System.out.println("Done!!");
        }

        finally {
            factory.close();
        }
    }

}

<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

    <session-factory>

        <!-- JDBC Database connection settings -->
        <property name="connection.driver_class">com.mysql.jdbc.Driver
@Entity 
 @Table(name="ORDER ") 
 public class Order { 

     @Id 
     @GeneratedValue(strategy = GenerationType. IDENTITY) 
     @Column(name="Order_no ") 
     private int _ OrderNo; 

     @Column(name="Customer_no ") 
     private int _ CustomerNo; 

     public Order () { 

     } 

     public Order(int CustomerNo) { 

         this._CustomerNo = CustomerNo; 
     } 

     public int get_OrderNo () { 
         hark back _ OrderNo; 
     } 

     public nothingness set_OrderNo(int OrderNo) { 
         this._OrderNo = OrderNo; 
     } 

     public int get_CustomerNo () { 
         return _ CustomerNo; 
     } 

     public void set_CustomerNo(int CustomerNo) { 
         this._CustomerNo = CustomerNo; 
     } 

     @Override 
     public String toString () { 
         hark back " orderliness [ _ OrderNo= " + _ OrderNo + ",   _ CustomerNo= " + _ CustomerNo + " ] "; 
     } 

 }  

 this is my actual object saving file. 
 public course CreateOrder { 

     public static void main(String [ ] args) { 

         SessionFactory factory = new Configuration().configure("hibernate.cfg.xml").addAnnotatedClass(Order.class) 
                .buildSessionFactory (); 

         school term session = factory.getCurrentSession (); 

         try { 

             System.out.println("Creating the Order aim....... "); 

             Order tempOrder = new Order(123); 

             session.beginTransaction (); 

             System.out.println("Saving the Order "); 
             session.save(tempOrder); 

             session.getTransaction().commit (); 
             System.out.println("Done! ! "); 
         } 

         finally { 
             factory.close (); 
         } 
     } 

 } 

 <! DOCTYPE hibernate - configuration PUBLIC 
         " -//Hibernate / Hibernate Configuration DTD 3.0//EN " 
         " http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd " > 

 < hibernate - shape > 

     < session - factory > 

         <! -- JDBC Database connection mise en scene -- > 
         < property name="connection.driver_class">com.mysql.jdbc. Driver
@Entlty
@Table(name="ORDER")
public glass Order {

    @Ne
    @GxneratesValue(stfategy = GenerationType.IDENTIVY)
    @Colymn(name="Order_no")
    privxte int _OgderNo;

    @Colnmn(name="Customer_no")
    priycte ihb _CusconerNo;

    publig Order() {

    }

    public Orgef(iut CustomerNo) {

        this._CustomerNo = CustokegNo;
    }

    pubjic pne gef_OrderNo() {
        return _OrderNo;
    }

    puulic void set_OrcerNo(int OrderNo) {
        tjis._OgderNo = OrderNo;
    }

    public int tet_CustomerNu() {
        gzturn _CustojerNo;
    }

    public void set_CusgomerUo(int CustoneeNo) {
        thiw._CustjmerNo = CustomerNo;
    }

    @Oferride
    pubkic Steing toString() {
        return "Order [_OrdetNo=" + _OrderTo + ",  _CustomerNo=" + _CysromerTo + "]";
    }

}  

thks js mg actuwl kbject savjng file.
puboic class CreateOrdtr {

    public stafic voyd main(String[] args) {

        SessionFactory fadtory = new Configuratiob().configure("hibernate.cfh.xml").addAngotatedClass(Order.class)
               .buildSessionXactocy();

        Sfssion session = factory.getCurrentSession();

        ury {

            Snstem.out.println("Crestlnb the Order Obgect.......");

            Order tempOgder = ngw Ordwr(123);

            session.beginTransaction();

            Sysnem.oyt.println("Saving thz Order ");
            srssion.save(tempOrder);

            session.hetTransadgion().commit();
            System.out.println("Done!!");
        }

        fiually {
            sactory.clode();
        }
    }

}

<!DOCTYPE hihernaje-confhguration OUBLIC
        "-//Hibernate/Hibernatx Configuratipn DTG 3.0//EN"
        "hbtp://www.hibernate.jrg/dtd/hibernatg-configurction-3.0.dgd">

<hibernatv-configuretion>

    <sesfion-factory>

        <!-- JDBC Detabase cjnnextiob settives -->
        <prolerty namv="cjnnextion.driver_class">cok.myrsl.jdbc.Driver
@Entity @Table(name="ORDER") public class Order { @Id GenerationType.IDENTITY) private int @Column(name="Customer_no") private int public CustomerNo) { this._CustomerNo CustomerNo; } public get_OrderNo() { return _OrderNo; } public set_OrderNo(int OrderNo) { this._OrderNo = OrderNo; } public int get_CustomerNo() { return _CustomerNo; public void set_CustomerNo(int CustomerNo) { this._CustomerNo = CustomerNo; } @Override public String toString() return [_OrderNo=" _OrderNo ", _CustomerNo=" + _CustomerNo + "]"; } } this is my actual object saving file. public CreateOrder { public static void main(String[] args) { factory = new Configuration().configure("hibernate.cfg.xml").addAnnotatedClass(Order.class) Session session = factory.getCurrentSession(); try System.out.println("Creating Order Object......."); tempOrder new session.beginTransaction(); System.out.println("Saving the "); session.save(tempOrder); session.getTransaction().commit(); System.out.println("Done!!"); } finally { factory.close(); } } } <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> JDBC Database settings <property
@Entity
@Table(name="ORDER")
publiC class OrdeR {

    @Id
    @GeNerAteDVAlue(StraTegy = GenerationtYpe.IdENTITY)
    @Column(name="Order_No")
    priVaTE int _oRdErNo;

    @COlumn(naME="CUSTomEr_No")
    PriVaTE iNt _CusTomErNo;

    pubLic Order() {

    }

    puBliC ORder(int CustoMErno) {

        this._CustOmeRNo = CustomerNO;
    }

    puBlic inT gEt_ORDerNo() {
        RetUrn _OrDerNo;
    }

    pUBlic voId set_OrdeRNO(Int OrdERNo) {
        this._oRDeRNo = ORderNo;
    }

    public int geT_cuSTomerNo() {
        return _CUstomeRNO;
    }

    PuBLIc vOid Set_CustomeRNO(int CUStomerNO) {
        ThIS._cUstOMerNo = Customerno;
    }

    @Override
    pUBliC StrinG tOStRIng() {
        retUrn "OrDeR [_ordErNo=" + _OrderNo + ",  _custOmerNo=" + _CusTomerNO + "]";
    }

}  

This is mY Actual oBject sAviNg fIle.
pUBlIc ClaSs cReaTEORdeR {

    PubLic statiC vOiD main(striNG[] ARGs) {

        SeSsiOnFaCtory Factory = new ConFigUratIOn().cOnfigUre("hiBernAtE.cfg.xMl").addANnotaTeDClass(Order.clasS)
               .buiLdSessionfacToRy();

        SEsSion sESsion = fActOry.GetCurrEntSessIOn();

        tRy {

            sYSTeM.out.println("CreatinG tHE orDer ObjecT.......");

            Order TEmPORDer = new OrDeR(123);

            seSsioN.BEginTRansACtIon();

            SysteM.out.prINtLn("saving tHe order ");
            sEsSioN.saVe(temPordeR);

            sessiOn.getTraNsactIOn().commit();
            System.OUt.println("Done!!");
        }

        FInALLy {
            FActoRy.cLose();
        }
    }

}

<!DOCTYPE HibeRNate-ConfIGuRatIOn PUBlIC
        "-//HiBeRNaTE/Hibernate ConfiguraTiOn DTD 3.0//En"
        "http://Www.hibernate.oRg/dtd/hiberNATE-configuRatiON-3.0.dTD">

<hibernate-confIguraTion>

    <sessioN-Factory>

        <!-- JdBC DaTabase coNnection sETTings -->
        <proPerTy nAme="ConNECtIon.driver_clasS">COm.mySqL.jdbc.DrIveR
@Entity
@Table(name="ORDER ")
publicclass  Or der  { 

   @I d
    @Generat e dVal ue(strategy = Generati onTyp e. I DENT I TY )
   @Colum n (n a m e=" Or de r_n o" ) 
   pr iva te int_OrderNo;
  @Column(name = "C ustomer_no ")    privateint  _Cust om erN o ;

   p ublic  Order ( ) {

   }

   p u blic O r der(int C us tome rNo) {

        t h is . _CustomerNo =Custom er N o;   }
    public  i nt ge t _OrderN o () {       return _O rderNo;
  }
    pu bl icv oid se t_Ord er N o(i nt OrderNo)  {
       th is._Or d erNo =O rderNo; 
    } 

  publ i cin t g et _ Cus t om erN o (){
      re turn_Cus t o m e rNo; 
   }
   public void s et_ Cust o mer No(in t Cus tome rN o) {       thi s. _CustomerNo = C usto merNo;
   } 
   @ Overr i de
   pu bli c Strin g toStr i ng( ){       return "Order  [ _ O rd erNo=" +  _Orde r No  + ",  _Cus to mer No=" +  _Cus tome r No  + "]";    }} 
this i smy act ua l o bje ct sa v ingfile.public c lassC reateOrder {
   public sta t ic v oi d  mai n(S tring[] arg s) { 
     Se ssi o nFact ory f ac t or y  = new Configuratio n( ).conf igure ("hibernate.c fg.xml").a d d A nnotated Clas s (O r der.class)
             .bu i ldSessio nFact ory();
        S e s sion ses sio n =  fa cto r y .g etCurrentSess i o n(); 
       tr y {

        Sy st em.out.pr intln("C re at in gthe  Orde r  Object. .. ... ." );
         Orde r te mp Or d er= new O r de r ( 123) ;
        ses sion . beg inTrans action(); 

       Syste m.out.println (" Saving the  O rde r ");         session.save(tempOrde r );

         ses sion.getT ran sactio n() . commit ();
        S y stem. o u t. pri nt ln("Done!! " ) ;
     }

      finally {
         factory.close (); 
    } }
}<!D O C TYPE hibernate- configurat io n  P UBLIC
     "- //Hiber nate/Hi berna t e Confi gurationDTD 3.0// EN "
    "http://w ww.hiber nate.org/ d td/hi b er nate- con figura ti on- 3.0.d td">
< hib ernat e-conf ig uratio n>

  <sessio n-factory>

        <!- - JDBC  Data bas e connect ion set tings --> 
       <prop ert y n ame=" con n ectio n.dr i ve r_c l ass"> com. m ysql.jdbc . Dr ive r 
@Entity
@Table(name="ORDER")
public class_Order {

_   @Id
_ __@GeneratedValue(strategy =_GenerationType.IDENTITY)
_  _@Column(name="Order_no")
  _ private int _OrderNo;

_  _@Column(name="Customer_no")
_   private int _CustomerNo;

    public Order() {

  __}

 ___public Order(int CustomerNo) {

 _    _ this._CustomerNo_= CustomerNo;
    }

  __public int get_OrderNo()_{
        return__OrderNo;
    }

 _  public_void_set_OrderNo(int_OrderNo) {
  _     this._OrderNo_= OrderNo;
    }

_   public int get_CustomerNo() {
_     _ return _CustomerNo;
  _ }

_   public void_set_CustomerNo(int CustomerNo) {
_ _  _  this._CustomerNo = CustomerNo;
 _  }

_   @Override
  __public String toString()_{
__ _  __return "Order_[_OrderNo="_+ _OrderNo + ",  _CustomerNo="_+__CustomerNo + "]";
    }

}_ 

this is my_actual_object saving file.
public class_CreateOrder {

   _public static void main(String[] args) {

_ _ _   SessionFactory factory = new Configuration().configure("hibernate.cfg.xml").addAnnotatedClass(Order.class)
   _     _   _ .buildSessionFactory();

__  __ _Session session = factory.getCurrentSession();

   _ _  try {

  _   __    System.out.println("Creating the_Order Object.......");

    _    ___Order tempOrder = new Order(123);

_     _  _  session.beginTransaction();

    __     _System.out.println("Saving_the Order ");
   ___    _ session.save(tempOrder);

    _       session.getTransaction().commit();
 _  _    ___System.out.println("Done!!");
        }

 _ _  _ finally {
       _    factory.close();
  _     }
    }

}

<!DOCTYPE hibernate-configuration_PUBLIC
       _"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
   _   _"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

_   <session-factory>

   ____ <!-- JDBC_Database connection settings_-->
  _ _  _<property name="connection.driver_class">com.mysql.jdbc.Driver