java – Spring vs Hibernate

java – Spring vs Hibernate

…could I get away with just adopting Hibernate for the simple things I need to do?


Hibernate is for ORM ( object relational mapping ) that is, make your objects persistent to a RDBMS.

Spring goes further. It may be used also as a AOP, Dependency Injector, a Web Application and ORM among other things.

So if you only need ORM, just use Hibernate. Time will come when you need Spring, and you will learn it then.

Heres an architectural view of Spring:


And this is Hibernate:


Spring and Hibernate are totally different frameworks for different problems. Spring is a huge framework with many many features, Hibernate is an O/R bridge.

I would recommend using plain old JDBC in your case (just some SQL inserts in Oracle).

java – Spring vs Hibernate

You could get away with using just spring and spring-JDBC integration. Depending on the complexity of your data-access needs it may be more than enough. The spring Object-relation mapping is also worth looking into if youre going to do a lot of data-access.

The nice thing about spring is that its a very loosely coupled framework. So you can read up on the bits you use, and forget the rest – even in the runtime.

Leave a Reply

Your email address will not be published. Required fields are marked *