Skip to content

Commit 0be7aa0

Browse files
dupirefrmaibin
authored andcommitted
dupirefr/dupire.francois+pro@gmail.com [BAEL-1981] Spring data jpa dates (eugenp#4795)
* [BAEL-1981] Article entity and repository + tests * [BAEL-1981] Removing unnecessary fields * [BAEL-1981] spring-data-jpa module creation
1 parent ecb14dd commit 0be7aa0

8 files changed

Lines changed: 57 additions & 0 deletions

File tree

‎pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@
433433
<module>spring-data-couchbase-2</module>
434434
<module>persistence-modules/spring-data-dynamodb</module>
435435
<module>spring-data-elasticsearch</module>
436+
<module>spring-data-jpa</module>
436437
<module>spring-data-keyvalue</module>
437438
<module>spring-data-mongodb</module>
438439
<module>persistence-modules/spring-data-neo4j</module>

‎spring-data-jpa/pom.xml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>parent-boot-2</artifactId>
7+
<groupId>com.baeldung</groupId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<relativePath>../parent-boot-2</relativePath>
10+
</parent>
11+
<modelVersion>4.0.0</modelVersion>
12+
13+
<artifactId>spring-data-jpa</artifactId>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.springframework.boot</groupId>
18+
<artifactId>spring-boot-starter-data-jpa</artifactId>
19+
</dependency>
20+
<dependency>
21+
<groupId>com.h2database</groupId>
22+
<artifactId>h2</artifactId>
23+
</dependency>
24+
</dependencies>
25+
26+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.baeldung;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.context.ApplicationContext;
6+
7+
@SpringBootApplication
8+
public class Application {
9+
private static ApplicationContext applicationContext;
10+
11+
public static void main(String[] args) {
12+
applicationContext = SpringApplication.run(Application.class, args);
13+
}
14+
}

spring-boot-persistence/src/main/java/com/baeldung/domain/Article.java renamed to spring-data-jpa/src/main/java/com/baeldung/domain/Article.java

File renamed without changes.

spring-boot-persistence/src/main/java/com/baeldung/repository/ArticleRepository.java renamed to spring-data-jpa/src/main/java/com/baeldung/repository/ArticleRepository.java

File renamed without changes.

spring-boot-persistence/src/test/java/com/baeldung/repository/ArticleRepositoryIntegrationTest.java renamed to spring-data-jpa/src/test/java/com/baeldung/repository/ArticleRepositoryIntegrationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.baeldung.repository;
22

33
import com.baeldung.domain.Article;
4+
import com.baeldung.repository.ArticleRepository;
45
import org.junit.Test;
56
import org.junit.runner.RunWith;
67
import org.springframework.beans.factory.annotation.Autowired;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# spring.datasource.x
2+
spring.datasource.driver-class-name=org.h2.Driver
3+
spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
4+
spring.datasource.username=sa
5+
spring.datasource.password=sa
6+
7+
# hibernate.X
8+
hibernate.dialect=org.hibernate.dialect.H2Dialect
9+
hibernate.show_sql=true
10+
hibernate.hbm2ddl.auto=create-drop
11+
hibernate.cache.use_second_level_cache=true
12+
hibernate.cache.use_query_cache=true
13+
hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory
14+
15+
spring.datasource.data=import_articles.sql

spring-boot-persistence/src/test/resources/import_articles.sql renamed to spring-data-jpa/src/test/resources/import_articles.sql

File renamed without changes.

0 commit comments

Comments
 (0)