Monday, 4 December 2017

Hibernate-Introduction

Hibernate in java, introduction to hibernate, what is hibernate, hibernate feature, hibernate disadvantage.


Ø  Hibernate is a non-invasive framework, means it won't forces the programmers to extend/implement arly class/interface, and in hibernate we have all POJO classes so its light weight 

Ø  Hibernate can run with or without server, I mean it will suitable for all types of applications (desktop or web applications) 

What is a framework?
    A framework  is reusable semi finished application that can be customized to develop a  specific application.

Features of hibernate

Ø  Hibernate persists java objects into database (Instead of primitives) 9
Ø  It provides Database services in Database vendor independent Manner, so that java applications I I become portable across the multiple databases
Ø  Hibernate generates efficient queries for java application to communicate with Database .
Ø  It provides fine-grained exception handling mechanism.
Ø  In hibernate we only have Un-checked exceptions, so no need to write try, catch, or no need to write throws (In hibernate we have the translator which converts checked to Un-checked)
Ø  it supports synchronization between in-memory java objects and relational records I
Ø  Hibernate provides implicit connection pooling mechanism !
Ø  Hibernate supports Inheritance, Associations, Collections .
Ø  Hibernate supports a special query language(HQL) which is Database vendor independent
Ø  Hibernate has capability to generate primary keys automatically while we are storing the records.
Ø  Hibernate often reduces the amount of code needed to be written, so it improves  the productivity
Ø  Database objects (tables, views, procedures, cursors, functions ... etc) name changes will not affect hibernate code
Ø  Lazy loading concept is also included in hibernate so you can easily load objects on start up time.

Disadvantages of hibernate?


Ø Since hibernate generates lots of SQL statements at runtime so it is slower than pure JDBC .
Ø  Hibernate is not much flexible in case of composite mapping. This is not disadvantage since 1 understanding of conlposite mapping is complex
Ø  Hibernate does not support some type of queries which are supported by JDBC .
Ø  Boilerplate code issue, actually we need to write same code in several files in the same  application, but spring eliminated this

Ø  Java Application makes use of hibernate API methods calls to inform the persistent needs to hibernate. Then Hibernate engine generate .lDBC code that corresponds to the underlying DB by using  mapping file and configuration file information..


DashZin

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment