Explain the role of session interface in hibernate.



Explain the role of session interface in hibernate...

Answer / Uzma Naz

The Session interface plays a crucial role in Hibernate as it acts as a bridge between Java objects and the database. It provides methods to persist, update, delete, and query Java objects. The main responsibilities of the Session interface include:
1. Persisting new objects into the database.
2. Updating existing objects in the database.
3. Deleting objects from the database.
4. Querying the database using Hibernate Query Language (HQL) or Criteria API.
5. Managing transactions and connection pools.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

In which condition is one to many relationship used?

1 Answers  


What are the key components of a hibernate configuration object?

1 Answers  


How mapping of java objects is done with database tables?

1 Answers  


What is the difference between persist and save in hibernate?

1 Answers  


What is ehcache in hibernate?

1 Answers  


What is the use of hibernateutil?

1 Answers  


What is detached in hibernate?

1 Answers  


Does hibernate use jdbc internally?

1 Answers  


How primary key is created by using hibernate?

1 Answers  


What are the three orm levels?

1 Answers  


What are the core interfaces are of hibernate framework?

1 Answers  


What are native queries?

1 Answers  


Categories