We can run the archetype either using a wizard within Eclipse, or outside Eclipse and then import (similar to the steps in Section A.1, “Obtain the Claims Application”). To use the wizard:
use
to bring up the wizard dialogskip the first page of the wizard; on the second page, select the catalog "Nexus Indexer" and then select the latest version of the jpaobjects-integration archetype
on the final page, enter:
group Id
of
org.nakedobjects.examples
artifact Id
of
claims-jpa
package
of
org.nakedobjects.examples.claims-jpa
the additional appRootArtifactId
variable to claims (that is, the
artifact Id
of the example
application)
Hit Finish
Maven will now generate four new projects in your workspace, as shown below:
Running through these in detail:
the claims-jpa-dom project holds a copy of the original classes in claims-dom, updated to include the JPA annotations. We'll be copying these source files over the original versions in just a minute
the claims-jpa-service project provides implementation of the two repositories. We'll use this project as a complete replacement for the original claims-service.
The claims-jpa-dba has no code in it but instead has Eclipse launch configuration to allow us (or our DBA) to create the database schema and to seed the database with our fixtures
The claims-jpa project is just a parent for the above three projects.
Before we go any further, this would be a good time to check database connectivity.
Now, use dba - Ping - PostgreSQL
launch configuration (from
the claims-jpa-dba project). Inspect the command line
arguments. If you are using the PostgreSQL database (as set up in Section A.2, “Set up a Relational Database”) then the arguments should be
correct, but if using your own database then you'll need to adjust
them.
When ready, choose Ping
is a very simple class so the problem will
almost certainly be in your setup somewhere).
Now let's update the existing projects to reference the newly generated projects.