日期:2014-05-18 浏览次数:20713 次
try {
Session session=sessionFactory.getCurrentSession();
//session.getTransaction().begin();
session.save(adduserNewuser);
//session.getTransaction().commit();
} catch (Exception e) {
// TODO: handle exception
System.out.println(e);
}
try {
Session session=sessionFactory.getCurrentSession();
session.getTransaction().begin();
session.save(adduserNewuser);
session.getTransaction().commit();
} catch (Exception e) {
// TODO: handle exception
System.out.println(e);
}
<id name="id" type="java.lang.Integer">
<column name="id" precision="5" scale="0" />
<generator class="identity" />
</id>