Java Reference
In-Depth Information
Listing 9-53. Customer.java Updated with an E-mail Field
package com.apress.springbatch.chapter9;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="customer")
public class Customer implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
private String firstName;
private String middleInitial;
private String lastName;
private String address;
private String city;
private String state;
private String zip;
private String email;
// Accessors go here
...
}
Because the job is storing the customer information in the database, let's take a quick look at how
that interaction works. To start, Figure 9-7 has the data model for the Customer table you use in this
example.
 
Search WWH ::




Custom Search