Thursday, 16 February 2012

How does hibernate code looks like? | Java Hibernate

Session session = getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
MyPersistanceClass mpc = new MyPersistanceClass ("Sample App");
session.save(mpc);
tx.commit();
session.close(); 
The Session and Transaction are the interfaces provided by hibernate. There are many other interfaces besides this. 

No comments: