Introduction
Spring is a Java™ framework for simplifying Java EE development. It has functionality for all layers of the Java EE application. It also does not enforce a specific programming model, so it is independent of the run-time environment, meaning it can be used in other application servers outside of the Java SE environment. Spring's popularity in recent years may be, at least partially, attributable to these design principles. Some Spring supporters even see the framework as a substitute for Java EE. In our view, the use of Java EE does not preclude the possibility of using Spring, and vice versa; instead, these technical components complement each other quite perfectly.
OpenJPA is a Java persistence API (JPA) implementation that can be traced back to the Solarmetric Kodo Java Data Objects (JDO) implementation. Kodo was acquired by BEA, which extended the Kodo to implement the Java persistence API and eventually developed the code base into an open source Apache OpenJPA. Through the relentless efforts of BEA and IBM and others on the project, the current OpenJPA has become a viable object-relational mapping tool for Java.
Sample Application
This article uses a basic WEB application called Events to demonstrate a variety of technologies that use Spring and OpenJPA to develop applications that run on the WebSphere application Server. We've designed a simple application that focuses on demonstrating how to use these technologies in combination. The example provides three simple use cases: adding events, listing events, and editing events. The user's information input is saved in the relational database. Users can view a list of events stored in the system (see Figure 1). For each event, the list of events displays an internal identifier and an event caption.
Figure 1. List Events