Skip to content

Commit a10036d

Browse files
authored
Merge pull request eugenp#11675 from hkhan/JAVA-8369-split-data-jpa-query-module
[JAVA-8369] Split spring-data-jpa-query-2 module
2 parents 9448ff6 + ac233f0 commit a10036d

File tree

12 files changed

+97
-5
lines changed

12 files changed

+97
-5
lines changed

persistence-modules/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<module>spring-data-jpa-filtering</module>
7676
<module>spring-data-jpa-query</module>
7777
<module>spring-data-jpa-query-2</module>
78+
<module>spring-data-jpa-query-3</module>
7879
<module>spring-data-jpa-repo</module>
7980
<module>spring-data-jpa-repo-2</module>
8081
<module>spring-data-jdbc</module>

persistence-modules/spring-data-jpa-query-2/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
## Spring Data JPA - Query
22

3-
This module contains articles about querying data using Spring Data JPA
3+
This module contains articles about querying data using Spring Data JPA .
4+
5+
### Relevant Articles:
46

5-
### Relevant Articles:
67
- [Spring Data JPA @Query](https://www.baeldung.com/spring-data-jpa-query)
78
- [Use Criteria Queries in a Spring Data Application](https://www.baeldung.com/spring-data-criteria-queries)
8-
- [Query Entities by Dates and Times with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-query-by-date)
99
- [Hibernate Pagination](https://www.baeldung.com/hibernate-pagination)
1010
- [Sorting with Hibernate](https://www.baeldung.com/hibernate-sort)
1111
- [Stored Procedures with Hibernate](https://www.baeldung.com/stored-procedures-with-hibernate-tutorial)
1212
- [Eager/Lazy Loading In Hibernate](https://www.baeldung.com/hibernate-lazy-eager-loading)
1313
- [Auditing with JPA, Hibernate, and Spring Data JPA](https://www.baeldung.com/database-auditing-jpa)
14-
15-
- More articles: [[<-- prev]](../spring-data-jpa-query)
14+
- More articles: [[<-- prev]](../spring-data-jpa-query)[[more -->]](../spring-data-jpa-query-3)
1615

1716
### Eclipse Config
1817
After importing the project into Eclipse, you may see the following error:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Spring Data JPA - Query
2+
3+
This module contains articles about querying data using Spring Data JPA.
4+
5+
### Relevant Articles:
6+
- [Query Entities by Dates and Times with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-query-by-date)
7+
- More articles: [[<-- prev]](../spring-data-jpa-query-2)
8+
9+
### Eclipse Config
10+
After importing the project into Eclipse, you may see the following error:
11+
"No persistence xml file found in project"
12+
13+
This can be ignored:
14+
- Project -> Properties -> Java Persistance -> JPA -> Error/Warnings -> Select Ignore on "No persistence xml file found in project"
15+
Or:
16+
- Eclipse -> Preferences - Validation - disable the "Build" execution of the JPA Validator
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
<modelVersion>4.0.0</modelVersion>
6+
<artifactId>spring-data-jpa-query-3</artifactId>
7+
<name>spring-data-jpa-query-3</name>
8+
9+
<parent>
10+
<groupId>com.baeldung</groupId>
11+
<artifactId>parent-boot-2</artifactId>
12+
<version>0.0.1-SNAPSHOT</version>
13+
<relativePath>../../parent-boot-2</relativePath>
14+
</parent>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.springframework.boot</groupId>
19+
<artifactId>spring-boot-starter-data-jpa</artifactId>
20+
</dependency>
21+
<dependency>
22+
<groupId>com.h2database</groupId>
23+
<artifactId>h2</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.springframework.boot</groupId>
27+
<artifactId>spring-boot-starter-test</artifactId>
28+
<scope>test</scope>
29+
</dependency>
30+
</dependencies>
31+
32+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.baeldung.spring.data.jpa.query;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class QueryApplication {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(QueryApplication.class, args);
11+
}
12+
13+
}

persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/spring/data/jpa/query/datetime/Article.java renamed to persistence-modules/spring-data-jpa-query-3/src/main/java/com/baeldung/spring/data/jpa/query/datetime/Article.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ public class Article {
99
@Id
1010
@GeneratedValue
1111
private Integer id;
12+
1213
@Temporal(TemporalType.DATE)
1314
private Date publicationDate;
15+
1416
@Temporal(TemporalType.TIME)
1517
private Date publicationTime;
18+
1619
@Temporal(TemporalType.TIMESTAMP)
1720
private Date creationDateTime;
1821

persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/spring/data/jpa/query/datetime/ArticleRepository.java renamed to persistence-modules/spring-data-jpa-query-3/src/main/java/com/baeldung/spring/data/jpa/query/datetime/ArticleRepository.java

File renamed without changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
spring.jpa.defer-datasource-initialization=true

persistence-modules/spring-data-jpa-query-2/src/main/resources/import_entities.sql renamed to persistence-modules/spring-data-jpa-query-3/src/main/resources/import_entities.sql

File renamed without changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
4+
<encoder>
5+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6+
</pattern>
7+
</encoder>
8+
</appender>
9+
10+
<logger name="org.springframework" level="WARN" />
11+
<logger name="org.springframework.transaction" level="WARN" />
12+
13+
<!-- in order to debug some marshalling issues, this needs to be TRACE -->
14+
<logger name="org.springframework.web.servlet.mvc" level="WARN" />
15+
16+
<root level="INFO">
17+
<appender-ref ref="STDOUT" />
18+
</root>
19+
</configuration>

0 commit comments

Comments
 (0)