Spring with ORM Frameworks

Spring gives API to effectively incorporate Spring with ORM systems, for example, Hibernate, JPA(Java Persistence API), JDO(Java Data Objects), Oracle Toplink and iBATIS.

Advantage of ORM Frameworks with Spring

There are a lot of advantage of Spring framework in respect to ORM frameworks. There are as follows:

  • Less coding is required: By the assistance of Spring structure, you don't have to compose additional codes previously, then after the fact the real database rationale, for example, getting the association, beginning exchange, commiting exchange, shutting association and so on.
  • Easy to test: Spring's IoC approach makes it easy to test the application.
  • Better exception handling: Spring framework provides its own API for exception handling with ORM framework.
  • Integrated transaction management: By the help of Spring framework, we can wrap our mapping code with an explicit template wrapper class or AOP style method interceptor.