Sessionsession=HibernateUtil.openSession();Transactiontx=null;tx=session.beginTransaction();Useruser=(User)session.get(User.class,538);System.out.println(user.getId());tx.commit();session.close();System.out.println(user.getName());Hibernate在使用get方法时...
查看全文