This hibernate tutorial provides in-depth concepts of Hibernate Framework with simplified examples. It was started in 2001 by Gavin King as an alternative to EJB2 style entity bean.
Hibernate Framework
Hibernate is a Java framework that simplifies the development of Java application to interact with the database. It is an open source, lightweight, ORM (Object Relational Mapping) tool. Hibernate implements the specifications of JPA (Java Persistence API) for data persistence.
ORM Tool
An ORM tool simplifies the data creation, data manipulation and data access. It is a programming technique that maps the object to the data stored in the database.
The ORM tool internally uses the JDBC API to interact with the database.
What is JPA?
Java Persistence API (JPA) is a Java specification that provides certain functionality and standard to ORM tools. The javax.persistence package contains the JPA classes and interfaces.
AD
https://delivery.adrecover.com/recover.html#packetId=00000001-6dd58b6e-ccc9-4495-98ef-43ce0718b42e&url=https%3A%2F%2Fwww.javatpoint.com%2Fhibernate-tutorial&siteId=37784&pageGroup=POST_ADRECOVER_0&removeStaticAds=false&isByod=false&height=90&width=728&networkProps=[{%22isInIframe%22:true,%22name%22:%22headerBidding%22,%22floorPrice%22:%22%22,%22isEnabled%22:true,%22criteo%22:{%22name%22:%22criteo%22,%22zoneId%22:%221474325%22},%22adpushup%22:{%22name%22:%22adpushup%22,%22blockAnimation%22:%22true%22,%22impType%22:%22native%22},%22oftmedia%22:{%22name%22:%22oftmedia%22,%22placementId%22:%2214595953%22},%22appnexus%22:{%22name%22:%22appnexus%22,%22placementId%22:%2220042668%22},%22openx%22:{%22name%22:%22openx%22,%22unit%22:%22541209178%22},%22sharethrough%22:{%22name%22:%22sharethrough%22,%22pkey%22:%22JZBgfF3jn9L1TPkVdTsQrP2Q%22},%22onetag%22:{%22name%22:%22onetag%22,%22pubId%22:%2262ff8a580aaea32%22,%22unitId%22:%22AR/37784_javatpoint.com%22},%22ix%22:{%22name%22:%22ix%22,%22siteId%22:%22371857%22},%22rubicon%22:{%22name%22:%22rubicon%22,%22accountId%22:%2220616%22,%22zoneId%22:%221411718%22,%22siteId%22:%22282370%22},%22pubmatic%22:{%22name%22:%22pubmatic%22,%22publisherId%22:%22158261%22,%22adSlot%22:%222240715%22},%22sovrn%22:{%22name%22:%22sovrn%22,%22tagid%22:%22656913%22},%22nobid%22:{%22name%22:%22nobid%22,%22siteId%22:%2222280936972%22,%22placementId%22:%2222281229443%22}},{%22isInIframe%22:true,%22dfpTagId%22:%22div-gpt-ad-1630663139270-0%22,%22dfpTagName%22:%22AR//37784_javatpoint.com_728x90%22,%22name%22:%22dfp%22,%22dfpNetworkId%22:%22103512698,22511567001%22,%22isEnabled%22:true,%22isOutrbrainDisabled%22:false}]&referrer=https%3A%2F%2Fwww.google.com%2F&pubEmailMd5=e224c2b5124a33f1f8d127266731a85e
Advantages of Hibernate Framework
Following are the advantages of hibernate framework:
1) Open Source and Lightweight
Hibernate framework is open source under the LGPL license and lightweight.
2) Fast Performance
The performance of hibernate framework is fast because cache is internally used in hibernate framework. There are two types of cache in hibernate framework first level cache and second level cache. First level cache is enabled by default.
3) Database Independent Query
HQL (Hibernate Query Language) is the object-oriented version of SQL. It generates the database independent queries. So you don’t need to write database specific queries. Before Hibernate, if database is changed for the project, we need to change the SQL query as well that leads to the maintenance problem.
4) Automatic Table Creation
Hibernate framework provides the facility to create the tables of the database automatically. So there is no need to create tables in the database manually.
5) Simplifies Complex Join
Fetching data from multiple tables is easy in hibernate framework.
6) Provides Query Statistics and Database Status
Hibernate supports Query cache and provide statistics about query and database status.