• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question About the book

 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Cameron,

I do not know Hibernate or other framework much but I see a lot of thread here in the ranch telling that I should use Persistence framework.

I used a lot of plain JDBC query in my application. I just want to know if this book explains the advantage of using Hibernate over plain old JDBC?

Sorry if my question might be vague but the title of your book caught my attention. I am thinking that it will teach me how to use Hibernate from ground up.. Thanks...
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed, the book very much describes why we might want to leverage a framework like Hibernate. A very interesting thread on the topic of using database frameworks can be read here: JavaRanch Thread on Why We Need a Framework Like Hibernate

Just a couple of important points might include:

1. When you embed JDBC into your Java application, you are really tightly tying your applications to your database. What happens if the names of your database talbes change? How many places do you need to change your code? With Hibernate and JPA annotations, you only need to update your mappings, and your Java code remains the same. That's a pretty compelling argument in itself.

2. Fundamentally, Java is an object oriented programming language, and Java programmers like to think about their problems in an object oriented way. But a database isn't object oriented. A database is structure, and it is manipulated with SQL, not Java. BUT, frameworks like Hibernate allow Java developers to think of their problems in an object oriented way. This is much more natural for Java developers, and allows applications to get to market faster, and be maintained in a manner that is easier and cheaper. In fact, with the Hibernate Criteria API, we can create extremely complex queries without having to write a single lick of SQL or even HQL. This is a significant leap forward, especially in a world where developers often have very strong Java skills, but don't necessarily have great database or SQL skills.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic