How to get session object in hibernate?



How to get session object in hibernate?..

Answer / Puneet Kumar Bhardwaj

To obtain a Session object in Hibernate, you can call the `getCurrentSession()` method on your Hibernate util class (such as `HibernateUtil`) or create a new one using `Factory.openSession()`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

What are the basic hibernate persistent annotations?

1 Answers  


What are the benefits of orm and hibernate?

1 Answers  


What is meant by unidirectional and bidirectional?

1 Answers  


How to fetch foreign key data in hibernate?

1 Answers  


What is the difference between persist and save in hibernate?

1 Answers  


How to bind hibernate session factory to jndi?

1 Answers  


What does session lock () method do in hibernate?

1 Answers  


What is transaction management in hibernate?

1 Answers  


What is the difference between merge and update method?

1 Answers  


What is one to many relationship hibernate?

1 Answers  


What is the difference between sorted and ordered collection in hibernate?

1 Answers  


What is hql in hadoop?

1 Answers  


Categories