Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit ffc0a6f

Browse files
try to fix it
1 parent ea7c3b0 commit ffc0a6f

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

pom.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
<scope>runtime</scope>
4545
<optional>true</optional>
4646
</dependency>
47-
<!--
47+
4848
<dependency>
4949
<groupId>com.h2database</groupId>
5050
<artifactId>h2</artifactId>
5151
<scope>runtime</scope>
5252
</dependency>
53-
-->
53+
5454
<dependency>
5555
<groupId>org.projectlombok</groupId>
5656
<artifactId>lombok</artifactId>
@@ -69,6 +69,7 @@
6969
<dependency>
7070
<groupId>org.postgresql</groupId>
7171
<artifactId>postgresql</artifactId>
72+
<version>42.6.0</version>
7273
<scope>runtime</scope>
7374
</dependency>
7475
</dependencies>

src/main/java/flurium/jing/JingApplication.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package flurium.jing;
22

3+
import org.springframework.beans.factory.annotation.Autowired;
34
import org.springframework.boot.SpringApplication;
45
import org.springframework.boot.autoconfigure.SpringBootApplication;
6+
import org.springframework.core.env.Environment;
57

68
@SpringBootApplication
79
public class JingApplication {
8-
910
public static void main(String[] args) {
1011
SpringApplication.run(JingApplication.class, args);
1112
}

src/main/java/flurium/jing/db/InitDatabase.java

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public class InitDatabase {
2020
@Bean
2121
public CommandLineRunner init() {
2222
return args -> {
23+
24+
/*
2325
var category1 = new Category("sport");
2426
var category2 = new Category("electronics");
2527
var category3 = new Category("food");
@@ -37,6 +39,8 @@ public CommandLineRunner init() {
3739
productRepository.save(product2);
3840
productRepository.save(product3);
3941
productRepository.save(product4);
42+
*/
4043
};
44+
4145
}
4246
}

src/main/resources/application.properties

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ spring.datasource.url=${JING_DATASOURCE_URL}
22
spring.datasource.username=${JING_DATASOURCE_USERNAME}
33
spring.datasource.password=${JING_DATASOURCE_PASSWORD}
44

5-
spring.jpa.hibernate.ddl-auto=update
5+
spring.h2.console.enabled=true
6+
spring.jpa.hibernate.ddlAuto=update
67
spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.PostgreSQLDialect
7-
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
8-
spring.datasource.driver-class-name=org.postgresql.Driver
8+
spring.datasource.driverClassName=org.postgresql.Driver
9+
spring.jpa.properties.hibernate.format_sql=true

0 commit comments

Comments
 (0)