insert方法
public void insert(Object o){
Session session = HibernateSessionFactory.currentSession();
Transaction t = session.beginTransaction();
session.save(o);
t.commit();
HibernateSessionFactory.clossSession();
}
delete方法
public void delete(Object o,Serializable id){
Session session = HibernateSessionFactory.currentSession():
Transaction t = session.beginTransaction();
Object o = session.get(o.class,id);
if(o!=null){
session.delete(o);