摘要:
Configuration cfg = new Configuration().configure();//configure("hibernate.cfg.xml") SessionFactory sf = cfg.buildSessionFactory(); Session ss = sf.openSession(); Transaction ts = ss.beginTransaction(); Query query = ss.createQuery("from Teacher");List list = query.list();.....ts 阅读全文