Merge pull request #11675 from hkhan/JAVA-8369-split-data-jpa-query-module
[JAVA-8369] Split spring-data-jpa-query-2 module
This commit is contained in:
commit
25358076b1
@ -75,6 +75,7 @@
|
|||||||
<module>spring-data-jpa-filtering</module>
|
<module>spring-data-jpa-filtering</module>
|
||||||
<module>spring-data-jpa-query</module>
|
<module>spring-data-jpa-query</module>
|
||||||
<module>spring-data-jpa-query-2</module>
|
<module>spring-data-jpa-query-2</module>
|
||||||
|
<module>spring-data-jpa-query-3</module>
|
||||||
<module>spring-data-jpa-repo</module>
|
<module>spring-data-jpa-repo</module>
|
||||||
<module>spring-data-jpa-repo-2</module>
|
<module>spring-data-jpa-repo-2</module>
|
||||||
<module>spring-data-jdbc</module>
|
<module>spring-data-jdbc</module>
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
## Spring Data JPA - Query
|
## Spring Data JPA - Query
|
||||||
|
|
||||||
This module contains articles about querying data using Spring Data JPA
|
This module contains articles about querying data using Spring Data JPA .
|
||||||
|
|
||||||
### Relevant Articles:
|
### Relevant Articles:
|
||||||
|
|
||||||
- [Spring Data JPA @Query](https://www.baeldung.com/spring-data-jpa-query)
|
- [Spring Data JPA @Query](https://www.baeldung.com/spring-data-jpa-query)
|
||||||
- [Use Criteria Queries in a Spring Data Application](https://www.baeldung.com/spring-data-criteria-queries)
|
- [Use Criteria Queries in a Spring Data Application](https://www.baeldung.com/spring-data-criteria-queries)
|
||||||
- [Query Entities by Dates and Times with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-query-by-date)
|
|
||||||
- [Hibernate Pagination](https://www.baeldung.com/hibernate-pagination)
|
- [Hibernate Pagination](https://www.baeldung.com/hibernate-pagination)
|
||||||
- [Sorting with Hibernate](https://www.baeldung.com/hibernate-sort)
|
- [Sorting with Hibernate](https://www.baeldung.com/hibernate-sort)
|
||||||
- [Stored Procedures with Hibernate](https://www.baeldung.com/stored-procedures-with-hibernate-tutorial)
|
- [Stored Procedures with Hibernate](https://www.baeldung.com/stored-procedures-with-hibernate-tutorial)
|
||||||
- [Eager/Lazy Loading In Hibernate](https://www.baeldung.com/hibernate-lazy-eager-loading)
|
- [Eager/Lazy Loading In Hibernate](https://www.baeldung.com/hibernate-lazy-eager-loading)
|
||||||
- [Auditing with JPA, Hibernate, and Spring Data JPA](https://www.baeldung.com/database-auditing-jpa)
|
- [Auditing with JPA, Hibernate, and Spring Data JPA](https://www.baeldung.com/database-auditing-jpa)
|
||||||
|
- More articles: [[<-- prev]](../spring-data-jpa-query)[[more -->]](../spring-data-jpa-query-3)
|
||||||
- More articles: [[<-- prev]](../spring-data-jpa-query)
|
|
||||||
|
|
||||||
### Eclipse Config
|
### Eclipse Config
|
||||||
After importing the project into Eclipse, you may see the following error:
|
After importing the project into Eclipse, you may see the following error:
|
||||||
|
16
persistence-modules/spring-data-jpa-query-3/README.md
Normal file
16
persistence-modules/spring-data-jpa-query-3/README.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
## Spring Data JPA - Query
|
||||||
|
|
||||||
|
This module contains articles about querying data using Spring Data JPA.
|
||||||
|
|
||||||
|
### Relevant Articles:
|
||||||
|
- [Query Entities by Dates and Times with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-query-by-date)
|
||||||
|
- More articles: [[<-- prev]](../spring-data-jpa-query-2)
|
||||||
|
|
||||||
|
### Eclipse Config
|
||||||
|
After importing the project into Eclipse, you may see the following error:
|
||||||
|
"No persistence xml file found in project"
|
||||||
|
|
||||||
|
This can be ignored:
|
||||||
|
- Project -> Properties -> Java Persistance -> JPA -> Error/Warnings -> Select Ignore on "No persistence xml file found in project"
|
||||||
|
Or:
|
||||||
|
- Eclipse -> Preferences - Validation - disable the "Build" execution of the JPA Validator
|
32
persistence-modules/spring-data-jpa-query-3/pom.xml
Normal file
32
persistence-modules/spring-data-jpa-query-3/pom.xml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>spring-data-jpa-query-3</artifactId>
|
||||||
|
<name>spring-data-jpa-query-3</name>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>com.baeldung</groupId>
|
||||||
|
<artifactId>parent-boot-2</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<relativePath>../../parent-boot-2</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.baeldung.spring.data.jpa.query;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class QueryApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(QueryApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -9,10 +9,13 @@ public class Article {
|
|||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@Temporal(TemporalType.DATE)
|
@Temporal(TemporalType.DATE)
|
||||||
private Date publicationDate;
|
private Date publicationDate;
|
||||||
|
|
||||||
@Temporal(TemporalType.TIME)
|
@Temporal(TemporalType.TIME)
|
||||||
private Date publicationTime;
|
private Date publicationTime;
|
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date creationDateTime;
|
private Date creationDateTime;
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
spring.jpa.defer-datasource-initialization=true
|
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||||
|
</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<logger name="org.springframework" level="WARN" />
|
||||||
|
<logger name="org.springframework.transaction" level="WARN" />
|
||||||
|
|
||||||
|
<!-- in order to debug some marshalling issues, this needs to be TRACE -->
|
||||||
|
<logger name="org.springframework.web.servlet.mvc" level="WARN" />
|
||||||
|
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
</root>
|
||||||
|
</configuration>
|
@ -0,0 +1,8 @@
|
|||||||
|
jdbc.driverClassName=org.h2.Driver
|
||||||
|
jdbc.url=jdbc:h2:mem:test
|
||||||
|
jdbc.user=sa
|
||||||
|
jdbc.pass=
|
||||||
|
|
||||||
|
hibernate.dialect=org.hibernate.dialect.H2Dialect
|
||||||
|
hibernate.show_sql=false
|
||||||
|
hibernate.hbm2ddl.auto=create-drop
|
Loading…
x
Reference in New Issue
Block a user