public Customer loadCostomer(long i){  
  Session s =sessionFactory.openSession();
  Customer c = null;
  Transaction tx = null;
  try{
  tx=s.beginTransaction();
  c= (Customer)s.load(Customer.class,new Long(i));
  tx.commit();
 }
  finally{
  s.close();
  }
                    return c;   }