Skip to content

Commit 2e6ac34

Browse files
phasenraum2010phasenraum2010
authored andcommitted
JPA with PostgreSQL
1 parent db00b41 commit 2e6ac34

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<dependencies>
2929

3030
<!-- frontend -->
31+
<!--
3132
<dependency>
3233
<groupId>org.webjars</groupId>
3334
<artifactId>jquery</artifactId>
@@ -48,6 +49,7 @@
4849
<artifactId>popper.js</artifactId>
4950
<version>1.14.3</version>
5051
</dependency>
52+
-->
5153

5254
<!--- spring boot -->
5355
<dependency>
@@ -131,11 +133,13 @@
131133
<artifactId>spring-boot-devtools</artifactId>
132134
<scope>runtime</scope>
133135
</dependency>
136+
<!--
134137
<dependency>
135138
<groupId>com.h2database</groupId>
136139
<artifactId>h2</artifactId>
137140
<scope>runtime</scope>
138141
</dependency>
142+
-->
139143
<dependency>
140144
<groupId>org.springframework.boot</groupId>
141145
<artifactId>spring-boot-starter-test</artifactId>
@@ -151,6 +155,11 @@
151155
<artifactId>spring-restdocs-mockmvc</artifactId>
152156
<scope>test</scope>
153157
</dependency>
158+
<dependency>
159+
<groupId>io.github.jpenren</groupId>
160+
<artifactId>thymeleaf-spring-data-dialect</artifactId>
161+
<version>2.1.1</version>
162+
</dependency>
154163
</dependencies>
155164

156165
<build>

src/main/java/org/woehlke/learn/learnneo4j/LearnNeo4jApplication.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,25 @@
33
import org.springframework.beans.factory.annotation.Autowired;
44
import org.springframework.boot.CommandLineRunner;
55
import org.springframework.boot.SpringApplication;
6+
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
67
import org.springframework.boot.autoconfigure.SpringBootApplication;
78
import org.springframework.context.annotation.ComponentScan;
89
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
910
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
11+
import org.springframework.data.web.config.EnableSpringDataWebSupport;
1012
import org.springframework.transaction.annotation.EnableTransactionManagement;
13+
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
1114
import org.woehlke.learn.learnneo4j.model.Category;
1215
import org.woehlke.learn.learnneo4j.model.category.CategoryRepository;
1316

17+
18+
@ComponentScan({"org.woehlke.learn.learnneo4j.model","org.woehlke.learn.learnneo4j.components"})
1419
@EnableJpaRepositories({"org.woehlke.learn.learnneo4j.components.db"})
1520
@EnableNeo4jRepositories({"org.woehlke.learn.learnneo4j.model","org.woehlke.learn.learnneo4j.components"})
21+
@EnableAutoConfiguration
22+
@EnableWebMvc
1623
@EnableTransactionManagement
17-
@ComponentScan({"org.woehlke.learn.learnneo4j.model","org.woehlke.learn.learnneo4j.components"})
24+
@EnableSpringDataWebSupport
1825
@SpringBootApplication
1926
public class LearnNeo4jApplication implements CommandLineRunner {
2027

src/main/java/org/woehlke/learn/learnneo4j/model/category/CategoryController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import java.util.ArrayList;
1414
import java.util.List;
15+
1516
@Controller
1617
@RequestMapping("/node/category")
1718
public class CategoryController {

src/main/resources/application.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ spring.jpa.properties.hibernate.globally_quoted_identifiers=true
2424
spring.thymeleaf.cache=false
2525
spring.thymeleaf.enabled=true
2626
spring.thymeleaf.check-template-location=true
27+
spring.jpa.open-in-view=true
28+
spring.jpa.generate-ddl=true
29+
spring.jpa.show-sql=true
30+
# spring.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL94Dialect

0 commit comments

Comments
 (0)