在學(xué)習(xí)hibernate的時候,出現(xiàn)下列問題
Configuration config = new Configuration().configure();
SessionFactory sessionFactory = config.buildSessionFactory();
session = sessionFactory.openSession();
TbmStudent student = new TbmStudent();
student.setStudentNo("4587");
student.setStudentName("name4587");
student.setClassNo("B3");
student.setChinesePoint(69);
student.setMathematicsPoint(90);
student.setEnglishPoint(80);
student.setPhysicsPoint(60);
student.setChemistryPoint(79);
student.setModDate(new Date(System.currentTimeMillis()));
session.save(student);
session.flush();
log是顯示成功的,但數(shù)據(jù)庫中沒有數(shù)據(jù),可我已經(jīng)session.flush()了啊?這是為什么?
還有就是如果用transaction就可以了
快快樂樂、認(rèn)認(rèn)真真生活才是真。