Work through the following materials this week:
Read specified sections of Java Persistence and explain the given concepts.
Chapter 3, “What is Java persistence?”
Persistence in Java and how it relates to the impedance mismatch discussed in unit 8
POJOs
Chapter 4, “Persistence Products, Which to Use?” — Name 2–3 of the major JPA implementations and indicate which one we are using in this class.
Chapter 5, “Mapping, Round Pegs into Square Holes” — Annotate this Java class for object-relational mapping using Java Annotations with the property access type.
public class Solder { private String name; private String rank; private long serialNumber; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getRank() { return rank; } public void setRank(String rank) { this.rank = rank; } public String getSerialNumber() { return serialNumber; } public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } }
In particular, add annotations for the following.
You don’t need to run this code, but be familiar with the concepts and the annotations that implement them.
Chapter 6, “Runtime, Doing the Hokey Pokey (EntityManager)”
Entity Manager (Chapter 6 overview)
Injection — We’ll use J2EE dependency injection to access to a container-managed EntityManager (Chapter 6 overview).
Persistence operations — Name the four basic persistence operations (Section 6.2).
Review Intellij’s support to database connections and JPA.
Create a new J2EE application as you created the JDK/J2EE application in the previous lab, activating the following “Java Enterprise” libraries/frameworks.
Store it in your repo under cs342/12postrelational/Lab12
.
Databases and SQL — Note that Oracle must be running with the CPDB database loaded for this data connection to work.
cpdb&localhost
and make sure that “Test Connection”
works properly. You may need to download a required library (to make IDEA
happy; GlassFish already has all the required libraries).
Store a (low-resolution) screen dump image of your new app in the IDE. It should look something like the one shown to the right (but be lower-resolution). You’ll use this app as the basis for lab 12.