In an earlier excerpt from Spring: A Developer's Notebook, authors Bruce Tate and Justin Gehtland kicked off their discussion of object-relational (OR) persistence with a look at iBATIS. While compelling for some, this option requires serious involvement with SQL. In this excerpt from Chapter 5, they move on to frameworks that more thoroughly isolate your Spring app from SQL.
Java Data Objects (JDO) is an interface-based standard for persistence or, as Tate and Gehtland say, "the non-EJB standard for persistence in Java applications." Setting aside the controversies that once swirled over JDO, they look at how to bring a top implementation, Kodo, to bear on your Spring application. They then move on to the most popular of the OR frameworks, and perhaps the best integrated with Spring: Hibernate. As they point out, "though it's nonstandard, you could say that behind EJB, Hibernate is the most popular persistence framework in the world." This chapter not only helps you with the nuts and bolts of setting up each framework, but also clearly shows how different their approaches are.
As with all books in the Developer's Notebook series, you'll get the information in a straightforward, factual style, with the details you need to get the job done. In other words: "All lab, no lecture."
Download "Using Spring with JDO and Using Spring with Hibernate" from Spring: A Developer's Notebook (PDF, 168K).
View catalog information for Spring: A Developer's Notebook.
Return to ONJava.com.
Copyright © 2009 O'Reilly Media, Inc.