This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Spring and the fly likes Does Spring Framework provide an ORM? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Does Spring Framework provide an ORM?" Watch "Does Spring Framework provide an ORM?" New topic
Author

Does Spring Framework provide an ORM?

Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

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.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

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.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9399
    
    2

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.
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1106
    
    1

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


Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

Which just goes to show that an interview doesn't always just reveal what the interviewee knows or doesn't know.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does Spring Framework provide an ORM?