From 27029333c09679c3c05c262e718259009261cc37 Mon Sep 17 00:00:00 2001 From: Jannik Seiler Date: Wed, 15 Jan 2020 20:02:31 +0100 Subject: [PATCH 1/3] Delete 'prototype/src/main/resources/test.db' --- prototype/src/main/resources/test.db | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 prototype/src/main/resources/test.db diff --git a/prototype/src/main/resources/test.db b/prototype/src/main/resources/test.db deleted file mode 100644 index 0c957329833423fbe5cfd2b66fe1cab1fa113e77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI&-AV#M6bJB`H4P=*K*URjy-87m(g$dZAtW{3Hpr{kbQT0Za%aTrdeokvo}kVy zC@FLs6#v7{?3vm5Sblc{b2sQrj1u7@ngvEQ*)ijsT?oM#OH)Zv*+iTlY#Q|D-}0Z* zG&^mHJbkqapUfUmg@6DAAOHafKmY;|fB*y_009X6zCho~lE)Ep!jD=l zS86`mZ>Fw1>H1Rm?qx@cy|LAKFjEbhS$k>l!*ZpGZpD=V(qNsZ2KKi z&1Id**vYngzPy&6=zHz1>kY+?918c|ziszuYFGCB1`V7B+QgeWSzkURJ>ewU?^wuG E0aDm!f&c&j From 25101f14e724d863f240ab4184f8052eb30a99f8 Mon Sep 17 00:00:00 2001 From: Seil0 Date: Wed, 15 Jan 2020 20:03:53 +0100 Subject: [PATCH 2/3] added databases in the resource folder to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e17d3e7..fdf52d7 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,6 @@ local.properties # Locally stored "Eclipse launch configurations" *.launch + +# SQLite +/src/main/resources/*.db From ec0f67784b3b18ebc3989e3312cf68354d81d051 Mon Sep 17 00:00:00 2001 From: Seil0 Date: Wed, 15 Jan 2020 20:30:48 +0100 Subject: [PATCH 3/3] create database and customer table if it does not exist --- .gitignore | 2 +- .../src/main/java/org/hso/ecommerce/entities/Customer.java | 3 ++- prototype/src/main/resources/application.properties | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fdf52d7..178b075 100644 --- a/.gitignore +++ b/.gitignore @@ -88,4 +88,4 @@ local.properties *.launch # SQLite -/src/main/resources/*.db +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