Skip to content

Commit 1988048

Browse files
committed
1 parent 5e7721b commit 1988048

File tree

2 files changed

+18
-4
lines changed
  • batch/chunk-csv-database/src/main

2 files changed

+18
-4
lines changed

batch/chunk-csv-database/src/main/java/org/javaee7/batch/chunk/csv/database/Person.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
import javax.persistence.Basic;
4444
import javax.persistence.Column;
4545
import javax.persistence.Entity;
46+
import javax.persistence.GeneratedValue;
47+
import javax.persistence.GenerationType;
4648
import javax.persistence.Id;
4749
import javax.persistence.NamedQueries;
4850
import javax.persistence.NamedQuery;
@@ -62,14 +64,18 @@
6264
@NamedQuery(name = "Person.findByName", query = "SELECT c FROM Person c WHERE c.name = :name"),
6365
@NamedQuery(name = "Person.findByHiredate", query = "SELECT c FROM Person c WHERE c.hiredate = :hiredate")})
6466
public class Person implements Serializable {
65-
private static final long serialVersionUID = 1L;
67+
6668
@Id
69+
@GeneratedValue(strategy = GenerationType.AUTO)
70+
private int id;
71+
72+
private static final long serialVersionUID = 1L;
6773
@Basic(optional = false)
6874
@NotNull
6975
@Size(min = 1, max = 50)
7076
@Column(name = "NAME")
7177
private String name;
72-
78+
7379
@Basic(optional = false)
7480
@NotNull
7581
@Size(min = 1, max = 50)
@@ -88,6 +94,14 @@ public Person(String name, String hiredate) {
8894
this.hiredate = hiredate;
8995
}
9096

97+
public int getId() {
98+
return id;
99+
}
100+
101+
public void setId(int id) {
102+
this.id = id;
103+
}
104+
91105
public String getName() {
92106
return name;
93107
}
@@ -128,5 +142,5 @@ public boolean equals(Object object) {
128142
public String toString() {
129143
return name;
130144
}
131-
145+
132146
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CREATE TABLE CHUNK_CSV_DATABASE ("NAME" VARCHAR(50) not null primary key, "HIREDATE" VARCHAR(50) not null)
1+
CREATE TABLE CHUNK_CSV_DATABASE ("ID" INTEGER not null primary key, "NAME" VARCHAR(50) not null primary key, "HIREDATE" VARCHAR(50) not null)

0 commit comments

Comments
 (0)