Describe the important interfaces of Hibernate framework?

devquora
devquora

Posted On: Feb 22, 2018

 

Important interfaces of Hibernate framework are:

  • SessionFactory (org.hibernate.SessionFactory)
    It is an immutable thread safe cache of compiled mappings for a single database.
    We are supposed to initialize SessionFactory once and then we are allowed to cache and reuse it.
    The SessionFactory instance is used to return the session objects for database operations.
  • Session (org.hibernate.Session)
    It is a single threaded and short-lived object, which represents a conversation between the persistent store and the application.
    The session should be opened only when it is required and should be closed as soon as the user is done.
    The session object is the interface between hibernate framework and Java application code and it provides methods for the CRUD operations.
  • Transaction (org.hibernate.transaction)
    It is a single threaded and short-lived object used by the application, which specifies atomic units of work.
    The application is abstracted from the underlying JDBC or JTA transaction.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Hibernate Interview Questions

    What is Hibernate ?

    Hibernate is a free software, which is distributed under GNU Lesser General public license 2.1. It is categorized under the Object Relational Mapping (ORM)...

    Hibernate Interview Questions

    What is HQL in Hibernate?

    HQL is the acronym of Hibernate Query Language.It considers the java objects in a similar way as that of the SQL. It is..

    Hibernate Interview Questions

    Explain the advantages of Hibernate?

    Some of the advantages of Hibernate are: It provides Simple Querying of data. An application server is not required to..