在学习hibernate的时候,出现下列问题
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是显示成功的,但数据库中没有数据,可我已经session.flush()了啊?这是为什么?
还有就是如果用transaction就可以了
快快乐乐、认认真真生活才是真。