1 / 4

What is Hibernate Framework

Hibernate is a java based ORM tool that provides a framework for mapping application domain objects to the relational database tables and vice versa.<br><br>Hibernate is probably the most popular JPA implementation and one of the most popular Java frameworks in general. Hibernate acts as an additional layer on top of JDBC and enables you to implement a database-independent persistence layer.

Ducat1
Download Presentation

What is Hibernate Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Welcome to Ducat India Apply Now Training & Certification Language | Industrial Training | Digital Marketing | Web Technology | Testing+ | Database | Networking | Mobile Application | ERP | Graphic | Big Data | Cloud Computing Call us: 70-70-90-50-90 www.ducatindia.com

  2. What is Hibernate Framework? Hibernate is a java based ORM tool that provides a framework for mapping application domain objects to the relational database tables and vice versa. Hibernate is probably the most popular JPA implementation and one of the most popular Java frameworks in general. Hibernate acts as an additional layer on top of JDBC and enables you to implement a database-independent persistence layer. It provides an object-relational mapping implementation that maps your database records to Java objects and generates the required SQL statements to replicate all operations to the database. Example: The below diagram shows an Object Relational Mapping between the Student Java class and student table in the database. What is ORM? Object-relational mapping or ORM is the programming technique to map application domain model objects to the relational database tables. Hibernate is a Java-based ORM tool that provides a framework for mapping application domain objects to the relational database tables and vice versa.

  3. What are the important benefits of using the Hibernate Framework? • Some of the important benefits of using hibernate framework are: • Hibernate eliminates all the boiler-plate code that comes with JDBC and takes care of managing resources, so we can focus on business logic. • Hibernate framework provides support for XML as well as JPA annotations, which makes our code implementation independent. • Hibernate provides a powerful query language (HQL) that is similar to SQL. However, HQL is fully object-oriented and understands concepts like inheritance, pol, morphism, and association. • Hibernate is an open-source project from Red Hat Community and is used worldwide. This makes it a better choice than others because the learning curve is small and there are tons of online documentation and help is easily available in forums. • Hibernate is easy to integrate with other Java EE frameworks, it’s so popular that Spring Framework provides built-in support for integrating hibernate with Spring applications. • Hibernate supports lazy initialization using proxy objects and performs actual database queries only when it’s required. • Hibernate cache helps us in getting better performance. • For a database vendor-specific feature, hibernate is suitable because we can also execute native SQL queries. • Overall hibernate is the best choice in the current market for the ORM tool, it contains all the features that you will ever need in an ORM tool.

  4. What are the advantages of Hibernate over JDBC? • Some of the important advantages of Hibernate framework over JDBC are: • Hibernate removes a lot of boiler-plate code that comes with JDBC API, the code looks cleaner and readable. • Hibernate supports inheritance, associations, and collections. These features are not present with JDBC API. • Hibernate implicitly provides transaction management, in fact, most of the queries can’t be executed outside a transaction. In JDBC API, we need to write code for transaction management using commit and rollback. • JDBC API throws SQL Exception which is a checked exception, so we need to write a lot of try-catch block code. Most of the time it’s redundant in every JDBC call and used for transaction management. Hibernate wraps JDBC exceptions and throws JDBCException or Hibernate Exception un-checked exception, so we don’t need to write code to handle it. Hibernate built-in transaction management removes the usage of try-catch blocks. • Hibernate Query Language (HQL) is more object-oriented and close to a Java programming language. For JDBC, we need to write native SQL queries. • Hibernate supports caching that is better for performance, JDBC queries are not cached hence performance is low. • Hibernate provides an option through which we can create database tables too, for JDBC tables must exist in the database. Read More: https://tutorials.ducatindia.com/java/hibernate-framework-overview-architecture-and-basics/

More Related