Any one can give me the gist of the main advantage of using Hibernate?
Hibernate lets you develop a maintainable data access layer with relative ease.
Hibernate is built on top of JDBC, so obviously it cannot do anything that plain JDBC cannot do. Hibernate is a large codebase; if you are building your own data access layer using plain JDBC, you will have lot more code to write to match its features. In simple reporting applications, it is relatively easy to code up the data access layer features you need; but as the application gets more complicated, the amount of code one has to write increases. Let me give you few examples that are non-trivial to implement by hand, but comes out of the box with Hibernate:
As I hinted before, implementing these by hand is not impossible - afterall, Hibernate does it. But they take significant investment in time. In many (most?) applications, concentrating on the complexities of the business logic would be a better investment of developer time.
Please see my comment in another thread regarding Hibernate performance.
I've found it useful if you need your application to work with several different databases. Hibernate will make it much easier to swap out a MySql DB with an Oracle one for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With