• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Does Spring Framework provide an ORM?

 
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have been using Spring for a while now but something keeps puzzling me. Does the Spring Framework have an ORM tool? Somthing on the lines of Hibernate or iBatis.

I am aware that using DI a Bean (DAO) can be 'injected' with a Hibernate implementation for database operations. If it does, what are the differences between Spring and other ORM tools available (esp Hibernate)?

Have been trying to find answers on the Internet but have found nothing worth mentioning yet... If anyone could provide any useful link I would love to read more on this topic.

Cheers,
Raj.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, Spring doesn't provide an ORM. Spring does integrate with the ORMS out there. Spring would never re-invent the wheel.

So We can integrate Hibernate with Spring so that we can inject a Hibernate SessionFactory into our Spring Repository beans. Or we can integrate with iBatis and inject an SQLMap or whatever the iBatis class is into our Spring Repositories.

Mark
 
Rajkamal Pillai
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a ton, Mark.

I was always asked during interviews why not use Spring ORM instead of Hibernate/iBatis. I spent so much time and effort searching the details about Spring ORM and I drew a blank. Based on this I had answered that Spring Framework does not provide an ORM. To my horror I was scorned at.

Your answer affirms my answers and I could not thank you enough for clarifying.

Cheers,
Raj.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Raj Kamal wrote:Thanks a ton, Mark.

I was always asked during interviews why not use Spring ORM instead of Hibernate/iBatis. I spent so much time and effort searching the details about Spring ORM and I drew a blank. Based on this I had answered that Spring Framework does not provide an ORM. To my horror I was scorned at.

Your answer affirms my answers and I could not thank you enough for clarifying.

Cheers,
Raj.



Mark was quite right. There is no such thing called Spring ORM but Spring offers beautiful ways of integrating with the existing ORM frameworks.
 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
beauty of Spring framework is "Integration". It provides seamless intgration to many technologies (Struts, Hibernate etc).
Although Spring do have built some of its own components like Spring MVC.

~ abhay
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the interviewer says that that is wrong. They might think that Spring's JdbcTemplate is an ORM, even though it is not. It is just a class that simplifies running queries through JDBC, with some callback interfaces that you can implement for converting ResultSet data into domain objects, but that is far from mapping in an Object Relational Mapping product.

Mark
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which just goes to show that an interview doesn't always just reveal what the interviewee knows or doesn't know.
reply
    Bookmark Topic Watch Topic
  • New Topic