The below conceptual Figure explains Hibernate Architecture Framework.
To create any Hibernate application or when any Hibernate Application is initialized, first create the Configuration Object. Hibernate can provide connection between
Java Classes and
Database tables. This is taken care of through different Configuration records bolstered by Hibernate. These Files are hibernated.cfg.XML, hibernate properties.
Configuration Object is utilized to create a
Session Factory Object. It can read the all Configure Properties and provides the operations. It initializes the
Session Object.
Session Factory is a
thread-safe object and it is used in all thread-based applications.
Session Factory Object is the
Heavy-Weight object. This object is created only once and later it will be using multiple times.
The session is utilized to get a physical association with the database. Session is a Light-Weight Object. The session will be made for each database operation and Session is introduced by utilizing SessionFactory Object. By Using the Session Object, persistence items are spared and recovered. Session Object is not a string safe item. Along these lines, Session Object can close or decimate unfailingly.
A Transaction speaks to a Unit of work with a Database table operations. Transactions of Hibernate is handled by
Transaction Manager or
JNDI and
JTA. Transaction object is optional. The transaction can be used in the Hibernate to perform some operations. Once a Transaction object is created, one have to commit that transaction.
To perform any operations in SQL or Hibernate object, create
Query Object.
Criteria Object is used only to perform
SELECT Query.