Hibernate Interview Questions and Answers
Question - 101 : - What is Session?
Answer - 101 : -
It maintains a connection between the hibernate application and database.
It provides methods to store, update, delete or fetch data from the database such as persist(), update(), delete(), load(), get() etc.
It is a factory of Query, Criteria and Transaction i.e. it provides factory methods to return these instances.
Question - 102 : - Is Session a thread-safe object?
Answer - 102 : -
No, Session is not a thread-safe object, many threads can access it simultaneously. In other words, you can share it between threads.
Question - 103 : - Define persistent classes.
Answer - 103 : -
Classes whose objects are stored in a database table are called as persistent classes.