Category Archives: Hibernate Interview Questions

State the role of SessionFactory interface plays in Hibernate. | Hibernate Questions

An application obtains Session instances from a SessionFactory which is typically single for the whole application created during its initialization. The SessionFactory caches generate SQL statements and other mapping metadata that Hibernate uses at runtime. It also holds cached data … Continue reading

Posted in Hibernate Interview Questions | Leave a comment

What is the difference between merge and update? | Hibernate Questions

update () : When the session does not contain an persistent instance with the same identifier, and if it is sure use update for the data persistence in hibernate. merge (): Irrespective of the state of a session, if there … Continue reading

Posted in Hibernate Interview Questions | Leave a comment

Why hibernate is advantageous over Entity Beans & JDBC? | Hibernate Questions

An entity bean always works under the EJB container, which allows reusing of the object external to the container. An object can not be detached in entity beans and in hibernate detached objects are supported. Hibernate is not database dependent … Continue reading

Posted in Hibernate Interview Questions | Leave a comment

Explain the difference between hibernate and Spring. | Hibernate Questions

Hibernate is an ORM tool for data persistence. Spring is a framework for enterprise applications. Spring supports hibernate and provides the different classes which are templates that contains the common code.

Posted in Hibernate Interview Questions | Leave a comment

Explain the main difference between Entity Beans and Hibernate. | Hibernate Questions

Entity beans are to be implemented by containers, classes, descriptors. Hibernate is just a tool that quickly persist the object tree to a class hierarchy in a database and without using a single SQL statement. The inheritance and polymorphism is … Continue reading

Posted in Hibernate Interview Questions | Leave a comment

What are the benefits of HibernateTemplate? | Hibernate Questions

The benefits of Hibernate Template are: HibernateTemplate, which is a Spring Template class, can simplify the interactions with Hibernate Sessions. Various common functions are simplified into single method invocations. The sessions of hibernate are closed automatically The exceptions will be … Continue reading

Posted in Hibernate Interview Questions | Leave a comment

What is a HibernateTemplate? | Hibernate Questions

HibernateTemplate is a helper class that is used to simplify the data access code. This class supports automatically converts HibernateExceptions which is a checked exception into DataAccessExceptions which is an unchecked exception. HibernateTemplate is typically used to implement data access … Continue reading

Posted in Hibernate Interview Questions | Leave a comment

What are the core interfaces of Hibernate framework? | Hibernate Questions

Session Interface: The basic interface for all hibernate applications. The instances are light weighted and can be created and destroyed without expensive process. SessionFactory interface: The delivery of session objects to hibernate applications is done by this interface. For the … Continue reading

Posted in Hibernate Interview Questions | Leave a comment

What is HQL? | Hibernate Questions

HQL stands for Hibernate Query Language. Hibernate allows the user to express queries in its own portable SQL extension and this is called as HQL. It also allows the user to express in native SQL.

Posted in Hibernate Interview Questions | Leave a comment

What is object/relational mapping metadata? | Hibernate Questions

ORM tools require a metadata format for the application to specify the mapping between classes and tables, properties and columns, associations and foreign keys, Java types and SQL types. This information is called the object/relational mapping metadata. It defines the … Continue reading

Posted in Hibernate Interview Questions | Leave a comment