Professional Java Development with the Spring Framework

Overview

We saw in the previous chapter how Spring supports transaction strategies and JTA transaction synchronization for a variety of Object-Relational mapping (O/R mapping) tools. Rather than providing its own O/R mapping implementation, Spring integrates with popular third-party solutions:

In this chapter, we will concentrate on iBATIS SQL Maps 2.0 and Hibernate 2.1 — two very popular persistence solutions, but with quite different approaches. While previous knowledge about those tools is not required, comprehensive coverage of either of them is outside of the scope of this chapter. We will instead introduce the basic principles and focus on usage in a Spring environment, as illustrated by our sample applications.

We will also discuss Spring's JDO integration, discussing the basic model and pointing out important similarities and differences to the Hibernate support, and Spring's TopLink support, to highlight the conceptual consistency within Spring's support for different O/R mapping frameworks. This conceptual basis shows how Spring will support JSR-220 persistence — the POJO persistence standard to be defined by the EJB 3.0 expert group — which is to be independent of the EJB 3.0 specification proper.

A full discussion of Apache OJB and Oracle TopLink is outside the scope of this book. The basic approach is similar to Hibernate and JDO, although there are differences in both semantics and features. Please refer to http://db.apache.org/ojb and www.oracle.com/technology/products/ias/toplink for further information on OJB and TopLink, respectively, and to the Spring reference documentation for information on how to integrate them into a Spring environment.

Note that all these strategies work within Spring's consistent DAO abstraction approach, allowing for mixed usage with Spring's own JDBC framework, and as far as possible also allowing for mixed usage of multiple O/R mapping strategies in the same application.

Категории