程序未报错,但数据总保存不到数据库,是什么原因?
代码如下:
public static void main(string[]args)
{
SessionFactory sf=new configration().configure().buildSessionFactory();
Session session = sf.OpenSession();
Medal medal = new medal();
medal.setOwner("totong");
medal.setType("gold medal");
Session.save(user);
Session.close();
}