1.

Explain Hibernate architecture

Answer»

The Hibernate architecture consists of MANY objects such as a persistent object, session factory, session, query, transaction, etc. Applications developed using Hibernate is MAINLY categorized into 4 parts:

  • Java Application
  • Hibernate framework - Configuration and Mapping Files
  • Internal API -
    • JDBC (Java Database Connectivity)
    • JTA (Java Transaction API)
    • JNDI (Java Naming Directory Interface).
  • Database - MySQL, PostGreSQL, Oracle, etc
Hibernate Architecture

 

The main elements of Hibernate framework are:

  • SessionFactory: This provides a factory method to get session objects and clients of ConnectionProvider. It holds a second-level cache (OPTIONAL) of data.
  • Session: This is a short-lived object that acts as an interface between the java application objects and database data.
    • The session can be used to generate transaction, query, and criteria objects.
    • It also has a mandatory first-level cache of data.
  • Transaction: This object specifies the atomic unit of work and has methods USEFUL for transaction management. This is optional.
  • ConnectionProvider: This is a factory of JDBC connection objects and it provides an ABSTRACTION to the application from the DriverManager. This is optional.
  • TransactionFactory: This is a factory of Transaction objects. It is optional.
Hibernate Objects


Discussion

No Comment Found