What is the Output of this program
public static void main(String[] args) {
UserDetails user= new UserDetails();
user.setUserName("Fist User");
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
Session session = sessionFactory.openSession();
session.beginTransaction();
user.setUserName("Second User");
user.setUserName("Third User");
session.save(user);
user.setUserName("Fourth User");
user.setUserName("Fifth User");
user.setUserName("Fifth User");
session.getTransaction().commit();
session.close();
}
Ans is - Fifth User
Please go through diagram
No comments:
Post a Comment