summaryrefslogtreecommitdiff
path: root/myapp/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'myapp/src/main')
-rw-r--r--myapp/src/main/java/io/trygvis/container/myapp/AddressBook.java3
-rw-r--r--myapp/src/main/java/io/trygvis/container/myapp/Person.java2
2 files changed, 5 insertions, 0 deletions
diff --git a/myapp/src/main/java/io/trygvis/container/myapp/AddressBook.java b/myapp/src/main/java/io/trygvis/container/myapp/AddressBook.java
index ec0bffa..0120b6a 100644
--- a/myapp/src/main/java/io/trygvis/container/myapp/AddressBook.java
+++ b/myapp/src/main/java/io/trygvis/container/myapp/AddressBook.java
@@ -87,6 +87,9 @@ public class AddressBook {
public void run(Connection c) throws Exception {
Statement statement = c.createStatement();
statement.executeUpdate(PersonDao.createTableSql);
+ for (String sql : Sequences.sequences) {
+ statement.executeUpdate(sql);
+ }
}
}
diff --git a/myapp/src/main/java/io/trygvis/container/myapp/Person.java b/myapp/src/main/java/io/trygvis/container/myapp/Person.java
index 6a7a694..be9026a 100644
--- a/myapp/src/main/java/io/trygvis/container/myapp/Person.java
+++ b/myapp/src/main/java/io/trygvis/container/myapp/Person.java
@@ -2,8 +2,10 @@ package io.trygvis.container.myapp;
import javax.persistence.Entity;
import javax.persistence.Id;
+import javax.persistence.SequenceGenerator;
@Entity
+@SequenceGenerator(name = "id_seq")
public class Person {
@Id
public Long id;