diff --git a/.gitignore b/.gitignore index e17d3e7..178b075 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,6 @@ local.properties # Locally stored "Eclipse launch configurations" *.launch + +# SQLite +prototype/src/main/resources/*.db diff --git a/prototype/src/main/java/org/hso/ecommerce/entities/Customer.java b/prototype/src/main/java/org/hso/ecommerce/entities/Customer.java index 42e85e2..609259a 100644 --- a/prototype/src/main/java/org/hso/ecommerce/entities/Customer.java +++ b/prototype/src/main/java/org/hso/ecommerce/entities/Customer.java @@ -7,7 +7,8 @@ import javax.persistence.*; public class Customer { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "id_Sequence") + @SequenceGenerator(name = "id_Sequence", sequenceName = "ID_SEQ") public Long id; public String lastname; public String firstname; diff --git a/prototype/src/main/resources/application.properties b/prototype/src/main/resources/application.properties index 6ef9ba3..f1ec900 100644 --- a/prototype/src/main/resources/application.properties +++ b/prototype/src/main/resources/application.properties @@ -9,6 +9,7 @@ logging.level.org.springframework.web=INFO spring.datasource.url = jdbc:sqlite:src/main/resources/test.db spring.datasource.driverClassName = org.sqlite.JDBC spring.jpa.properties.hibernate.dialect = org.hso.ecommerce.db.SQLiteDialect +spring.jpa.hibernate.ddl-auto=update # ---------------------------------------- # WEB PROPERTIES diff --git a/prototype/src/main/resources/test.db b/prototype/src/main/resources/test.db deleted file mode 100644 index 0c95732..0000000 Binary files a/prototype/src/main/resources/test.db and /dev/null differ