We have a bit of setup/initialization code we need to do before we can get started. We have seen all of this code before in Tutorial 1. The difference here is that we are going to work though some refactorings to get to where we were in tutorial 1. Here are the various parts:
Configure the Logger
Create the Entity Manager Factory
Create the Entity Manager
Create Entities
Use the Entity Manager
Perform a Query and Verify it Works
The Whole Thing
Here’s all of this put together. Note that we’re going to refactor this heavily coming up.
Get it Running
After creating your Test Class, verify that it runs and that this test passes:
Comments