Hibernate Interview Questions and Answers - Part 2

What is ORM? - Object Relational Model is a programming technique.....
What is Hibernate? - Hibernate is an ORM tool. Hibernate is a solution for object-relational mapping...
Why do you need ORM tool like Hibernate? - Hibernate is open source ORM tool. Hibernate reduces the time to perform database operations...
What are the main advantages of ORM like hibernate? - Distributed transaction can simply be performed by using ORM tools...
What are the core interfaces of Hibernate framework? - Session Interface, SessionFactory interface, Configuration Interface, Transaction Interface, Query and Criteria interface...
Explain how to configure Hibernate - Hibernate uses a file by name hibernate.cfg.xml. This file creates the connection pool and establishes the required environment....
What is a HibernateTemplate? - HibernateTemplate is a helper class that is used to simplify the data access code.
What are the benefits of HibernateTemplate? - HibernateTemplate, which is a Spring Template class, can simplify the interactions with Hibernate Sessions...
What is Hibernate proxy? - Mapping of classes can be made into a proxy instead of a table....
Explain the types of Hibernate instance states - The persistent class’s instance can be in any one of the three different states. ....
What are Collection types in Hibernate? - A collection is defined as a one-to-many reference...
What is lazy initialization in hibernate? - The delaying the object creation or calculating a value or some process until the first time it is needed...
What is lazy fetching in hibernate? - Lazy fetching is associated with child objects loading for its parents..
Difference between sorted and ordered collection in hibernate - The sorted collection is a collection that is sorted using the Java collections framework....
Difference between transient and detached objects - Transient objects do not have association with the databases and session objects...
Advantages and disadvantages of detached objects - Detached objects passing can be done across layers upto the presentation layer without using Data Transfer Objects. ...
What is Hibernate Query Language (HQL)? - Hibernate Query Language is designed for data management using Hibernate technology...
Flow of Hibernate communication with RDBMS - The Hibernate configuration is to be loaded and creation of configuration object is done. The mapping of all hbm files will be performed automatically...
Explain the role of Session interface in Hibernate - Session interface is a single threaded object..
What is a SessionFactory? - The SessionFactory is the concept that is a single data store and thread safe..
Role of SessionFactory interface plays - The SessionFactory is used to create Sessions...
Difference between load() and get() in Hibernate - The load() method throws an exception,when the unique id could not found in the database...
What is the difference between merge and update? - update () : When the session does not contain an persistent instance with the same identifier...
What is the advantage of Hibernate over jdbc? - Hibernate code will work well for all databases, for ex: Oracle,MySQL, etc. where as JDBC is database specific...
Why hibernate is advantageous over Entity Beans & JDBC - An entity bean always works under the EJB container, which allows reusing of the object external to the container....
Difference between Entity Beans and Hibernate - Entity beans are to be implemented by containers, classes, descriptors..
Difference between Hibernate and Spring - Hibernate is an ORM tool for data persistency. Spring is a framework for enterprise applications....