The Java Persistence API Training Course for Struts 2 is a step-by-step introduction to building applications using the new Java persistence standard with tried and true frameworks, like Struts 2, Hibernate 3, and Spring 2.

After completing the course, you will be equipped to create and maintain basic JPA applications using Struts 2, including all necessary client-side and server-side programming.

Presentations are reinforced by workshops designed to explore common problems and best-practice solutions. This course is intended for developers who want field-savvy advice on how to get your applications working the "Struts 2 JPA Way".

Audience

Developers and programmers who want to learn about web application development using JPA and Apache Struts 2.

Course Objectives

Identify and apply object relational modeling techniques

Utilize standard unit tests to deploy JPA solutions

Build a working JPA-enabled web application

Explore key best practices

Course Format

Sessions include a presentation and a workshop.

Presentations are reinforced by workshops designed to explore common problems and best practice solutions.

Workshops are described with standard use cases.

Source code for the completed workshops is available in the Apache Struts Sandbox.

Other Course materials are available through the this site

Prerequisites

To benefit from this course, participants should have experience programming with Java along with a basic knowledge of HTML and HTTP. Experience with a modern Java IDE, such as Eclipse, IDEA, or NetBeans, is also beneficial.

Course Status

The course is nearly code complete and being presented in the field for the first time the week of 10 Dec 2007. Source code for the completed workshops is available through the Apache Struts Sandbox.

Course Vendors

The course is being presented "in the field" by Struts Mentor.

Course Overview

We start from square one and discuss why we we need a ORM persistence solution, and how the JPA and Hibernate solve our persistence problems. In the lab, we use MyEclipse to create a simple JPA application.

The JPA encourages a layered architecture which implies a layered approach to testing. We learn how to interact with the the business and persistence layers through unit tests. In the lab, we work up a set of standard CRUD tests for our starter object.

With a development infrastructure in place, we take a closer look at object relational modeling, exploring the various types of relationships and associations objects share. In the lab, we move over to the Struts MailReader use cases, and create a User entity object.

In this session, we learn how to use annotations to describe object relationships and associations that the JPA cannot deduce on its own. In the lab, we extend the User object to include other properties, including a list of subscriptions.

Retrieving objects can be the most interesting part of the CRUD quartet. In this session, we put to task the Java Persistence API Query Language (JPL). In the lab, we authenticate a MailReader user by retrieving an account by username and password.

The JPA helps us persist objects. Spring helps us create and manage objects. In this session, we overview the core of the Spring framework and look at what utility it provides applications. In the lab, we use Spring to create fully-formed objects that we can use with our persistence tests.

JPA support is easy to hard-code into an application. Spring provides support for injecting JPA support into an application, which can simplify finely-grained transaction management and other advanced features. In the lab, we implement a MessageDAO and MessageService using the Spring JPA template.

The "last mile" of development is presenting an interface to the user. In this session, we overview the Struts 2 framework architecture and explore what value it adds to web development. In the lab, we setup a starter Struts 2 project and display a welcome page.

With a web development infrastructure in place, we walk through the Struts JPA MailReader to take a closer look at how it all fits together. (This session reviews live code rather than slides.) In the lab, we add a logon form to our web application.