I bought a book on Hibernate. I wanted to learn on what Hibernate is and what is Object Relational Mapping in general.
Harnessing Hibernate has good topics on Hibernate and I do think that I am able to write simple mapping classes now. My problem is, I think I am way ahead on the Hibernate but I really don't know why we need one.
The book explains Hibernate clearly but I think I am at lost because it does not discuss why we need Hibernate and an ORM.
I too would suggest starting at wikipedia.
From there, follow the links at the bottom.
To provide a short answer: An ORM is used to abstract from the data storage, usually a database. This can serve multiple purposes, among those:
At its core, it's about Separation of Concerns.
Data persistence and logic are two separate concerns. The application coder should not have to concern himself with what flavor of SQL the IT staff has decided to use this week, and how to translate between the different paradigms of relation entities and object hierarchy entities.
The DBA should also not need to concern himself with object ownership rules and other almost-leaky concerns from the business layer.
In reality, in larger systems, you rarely can be completely vendor-agnostic, and the DAO layer inevitably picks up some non-ORM-related queries for performance tweaks. Tools like Hibernate do the best they can to make these situations as rare and abstract as possible.
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