From 3d556bfcad3eb3face9db986aa570d6e2a059448 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 4 Aug 2013 12:34:48 +0200 Subject: wip --- myapp/src/main/java/io/trygvis/container/myapp/AddressBook.java | 3 +++ myapp/src/main/java/io/trygvis/container/myapp/Person.java | 2 ++ 2 files changed, 5 insertions(+) (limited to 'myapp/src/main/java/io/trygvis/container') 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; -- cgit v1.2.3