Hibernate / Hibernate interview questions
Benefits of hibernate over JDBC?
- Hibernate is database independent while in case of JDBC, developer has to write database specific queries.
- In case of Hibernate developer doesn't need to be an expert of writing complex queries as HQL simplifies query writing process while in case of JDBC, its job of developer to write and tune queries. HQL is more object oriented and close to Java.
- In Hibernate, Criteria Query takes care of Query Tuning. In case of JDBC you need to tune your queries.
- 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.
- Automatic primary key generation.
- Performance benefits like Lazy initialization, Outer join fetching, Batch fetching.
- Hibernate eliminates a lot of boiler plate code.
- Hibernate supports inheritance, associations, and collections.
- Hibernate implicitly provides transaction management.
- Hibernate wraps JDBCException that are unchecked so exception handling is NOT mandatory.
- Hibernate support cache memory.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
