Hi Friends..
Why do you need ORM tools like hibernate?
Thanks...........
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Jan 11, 2012, 11:41 AM
The main advantage of ORM like hibernate is that it shields developers from messy SQL. Apart from this, ORM provides following benefits:
1.Improved productivity
2.High-level object-oriented API
3.Less Java code to write
4.No SQL to write
5.Improved performance
6.Sophisticated caching
7.Lazy loading
8.Eager loading
9.Improved maintainability
10.A lot less code to write
11.mproved portability
12.ORM framework generates database-specific SQL for you
Advantages of hibernate over jdbc
1) Hibernate is data base independent, The code will work for all kind of database like Derby, MySQL,ORACLE, PostGreSQL, SQLServer etc.
Where as in JDBC query must be database specific
2) As Hibernate is set of Objects , No need of SQL knowledge.
In JDBC you need SQL Knowledge is must.
3) In Hibernate, Criteria Query take care of Query Tuning. In case of JDBC you need to tune your queries.
4) As Hibernate Supports two level of cache, you can store data into catch for better performance while in JDBC you need to implement your java cache.
5) Hibernate supports Query cache and It will provide the statistics about your query and database status.
JDBC Not provides any statistics.
6) Development fast in case of Hibernate because you don?t need to write queries
7) No need to create any connection pool in case of Hibernate. You can use c3p0.
In case of JDBC you need to write your own connection pool
8) In the xml file you can see all the relations between tables in case of Hibernate. Easy readability.
9) You can load your objects on start up using lazy=false in case of Hibernate.
But JDBC Don't have such support.
10 ) Hibernate Supports automatic versioning of rows but JDBC Not.
Thanks
Vikas MishraPosted Jan 31, 2012, 5:13 AM
Chintan RathodPosted Jan 11, 2012, 11:36 AM
ORM stands for object/relational mapping. ORM is the automated persistence of objects in a Java application to the tables in a relational database.
2.What does ORM consists of ?
An ORM solution consists of the followig four pieces:
- API for performing basic CRUD operations
- API to express queries refering to classes
- Facilities to specify metadata
- Optimization facilities : dirty checking,lazy associations fetching
3.What are the ORM levels ?The ORM levels are:
- Pure relational (stored procedure.)
- Light objects mapping (JDBC)
- Medium object mapping
- Full object Mapping (composition,inheritance, polymorphism, persistence by reachability)
4.What is Hibernate?Hibernate is a pure Java object-relational mapping (ORM) and persistence framework that allows you to map plain old Java objects to relational database tables using (XML) configuration files.Its purpose is to relieve the developer from a significant amount of relational data persistence-related programming tasks.
5.Why do you need ORM tools like hibernate?
The main advantage of ORM like hibernate is that it shields developers from messy SQL. Apart from this, ORM provides following benefits:
- High-level object-oriented API
- Less Java code to write
- No SQL to write
2. Improved performance- Sophisticated caching
- Lazy loading
- Eager loading
3. Improved maintainability- A lot less code to write
4. Improved portabilityThank you....