1) What is ORM ?
ORM stands for Object Relational Mapping. It is used technique to bridge between
Object Oriented programs to relational databases. It is manly for database
operation.
ORM internally uses JDBC API
2) What is Difference between JPA and Hibernate
JPA is Specification it given by sun microsystem ,It is part oracle. Hibernate
is JPA Implementation
3) What is Hibernate ?
Hibernate is light-weight, open-source, and simplifies the development java
applications to interact with databases. Hibernate is JPA Implementation .It helps
in mapping the Object Oriented programs to relational d atabases.
4) What is features of Hibernate ?
1) Light-Weight and Open-Source
2) Fast Performance :Hibernate supports cache mechanism
3) Database Independent Query : HQL generates the database independent queries.
You don't need to write database specific queries.
4) Automatic Table Creation
5) How will you map the columns of a DB table to the properties of a Java class in
Hibernate?
XML: We can map the column of a table to the property of a class in XML file.
Annotation: We can also use annotations @Entity and @Table to map a column to
the property of class.
6) What are the steps for creating a Session Factory in hibernate?
Configuration: First Creating a configuration object. This will refer to the path
of configuration file.
Resource: Add config file resource to configuration object.
Properties: Set properties in the Configuration object.
Session Factory : Use configuration object to build Session Factory.
7) Why do you use POJO in Hibernate?
POJO stands for plain old java Objects .A POJO is java bean with getter and
setter methods for each property of the bean. POJO also comes with a default
constructor that makes it easier to persist with a default constructor.