What is Hibernate?
Hibernate is a pure Java object-relational mapping (ORM) and persistence framework that allows you to map plain old Java objects to relational database tables using (XML) configuration files. Its purpose is to relieve the developer from a significant amount of relational data persistence-related programming tasks.
What is ORM ?
ORM stands for object/relational mapping. ORM is the automated persistence of objects in a Java application to the tables in a relational database.
What does ORM consists of ?
An ORM solution consists of the following four pieces:
- API for performing basic CRUD operations
- API to express queries referring to classes
- Facilities to specify metadata
- Optimization facilities : dirty checking, lazy associations fetching
What are the ORM levels ?
The ORM levels are:
- Pure relational (stored procedure.)
- Light objects mapping (JDBC)
- Medium object mapping
- Full object Mapping (composition, inheritance, polymorphism, persistence by reach ability)
Why do you need ORM tools like hibernate?
The main advantage of ORM like hibernate is that it shields developers from messy SQL. Apart from this, ORM provides following benefits: Improved productivity
- High-level object-oriented API
- Less Java code to write
- No SQL to write
- Sophisticated caching
- Lazy loading
- Eager loading
- A lot less code to write
- ORM framework generates database-specific SQL