From 5fbef7ba7e1a00c7b01790ddea537566a79b9c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Wed, 1 Mar 2017 18:40:54 +0100 Subject: [PATCH 01/27] Bump to spring-data-jpa 1.11.0.RELEASE --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c3fed9b..2040258 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ 1.6 - 1.11.0.BUILD-SNAPSHOT + 1.11.0.RELEASE 2.6.2 4.1.3 From 462d376da7d6c6d8bd1ba5c31708dc6ca6d3c62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Wed, 1 Mar 2017 18:41:32 +0100 Subject: [PATCH 02/27] [maven-release-plugin] prepare release spring-data-jpa-entity-graph-1.11.00 --- pom.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 2040258..0d48f8f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,5 @@ - + 4.0.0 Spring Data JPA EntityGraph @@ -10,7 +8,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.00-SNAPSHOT + 1.11.00 1.6 @@ -238,7 +236,8 @@ scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph https://github.com/Cosium/spring-data-jpa-entity-graph - + spring-data-jpa-entity-graph-1.11.00 + Cosium From a992393c39e673c201b08f6412a6aa0119bc686e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Wed, 1 Mar 2017 18:41:32 +0100 Subject: [PATCH 03/27] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0d48f8f..e638b77 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.00 + 1.11.01-SNAPSHOT 1.6 @@ -236,7 +236,7 @@ scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph https://github.com/Cosium/spring-data-jpa-entity-graph - spring-data-jpa-entity-graph-1.11.00 + HEAD From 11867acce2a47145ec8e0db80df5617307dfae71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Wed, 1 Mar 2017 19:10:22 +0100 Subject: [PATCH 04/27] Enhance compatibility documentation (cherry picked from commit 062f67a) --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e7d10a7..09293c0 100644 --- a/README.md +++ b/README.md @@ -14,27 +14,30 @@ Example: productRepository.findByName("foo", EntityGraphUtils.fromName("Product.brand")); ``` -## Compatibility +## Compatibility between spring-data-jpa and spring-data-jpa-entity-graph This library follows the Spring Data JPA versionning semantic. -spring-data-jpa-entity-graph | spring-data-jpa +spring-data-jpa branches | spring-data-jpa-entity-graph.version ---------------------------- | --------------- -1.11.x | 1.11.y -1.10.x | 1.10.y +1.12.x | Not released yet +1.11.x | 1.11.0 +1.10.x | 1.10.14 -## Quick start +Example: if you were using `spring-data-jpa 1.10.13` in your project, you would need to select any `spring-data-jpa-entity-graph 1.10.x`. Thus `spring-data-jpa-entity-graph 1.10.14` would be eligible. -1. In addition to spring-data-jpa, add the library dependency : +## Quick start +1. Select the `spring-data-jpa-entity-graph.version` from the above compatibility table +2. In addition to `spring-data-jpa`, add the library dependency : ```xml com.cosium.spring.data spring-data-jpa-entity-graph - 1.10.14 + ${spring-data-jpa-entity-graph.version} ``` -2. In your Spring configuration, set the repository factory bean class to `JpaEntityGraphRepositoryFactoryBean` : +3. In your Spring configuration, set the repository factory bean class to `JpaEntityGraphRepositoryFactoryBean` : ```java @Configuration @@ -43,7 +46,7 @@ spring-data-jpa-entity-graph | spring-data-jpa ... } ``` -3. Make sure your repositories extend `JpaEntityGraphRepository`, `JpaEntityGraphSpecificationExecutor` and/or `JpaEntityGraphQueryDslPredicateExecutor` +4. Make sure your repositories extend `JpaEntityGraphRepository`, `JpaEntityGraphSpecificationExecutor` and/or `JpaEntityGraphQueryDslPredicateExecutor` ## Basic Usage From e61b8b61cddf768478db0cdb2c889111ef7ccaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Wed, 1 Mar 2017 20:00:51 +0100 Subject: [PATCH 05/27] Correct 1.11 version (cherry picked from commit 51d11e1) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09293c0..424bb03 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This library follows the Spring Data JPA versionning semantic. spring-data-jpa branches | spring-data-jpa-entity-graph.version ---------------------------- | --------------- 1.12.x | Not released yet -1.11.x | 1.11.0 +1.11.x | 1.11.00 1.10.x | 1.10.14 Example: if you were using `spring-data-jpa 1.10.13` in your project, you would need to select any `spring-data-jpa-entity-graph 1.10.x`. Thus `spring-data-jpa-entity-graph 1.10.14` would be eligible. From 91a8638b2f9a9b4a4d7656a5103fa3c31f3ef316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Thu, 2 Mar 2017 01:23:03 +0100 Subject: [PATCH 06/27] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 424bb03..9e85e15 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Gitter](https://badges.gitter.im/Cosium/spring-data-jpa-entity-graph.svg)](https://gitter.im/Cosium/spring-data-jpa-entity-graph?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Travis branch](https://img.shields.io/travis/Cosium/spring-data-jpa-entity-graph/master.svg)](https://travis-ci.org/Cosium/spring-data-jpa-entity-graph) [![Codecov branch](https://img.shields.io/codecov/c/github/Cosium/spring-data-jpa-entity-graph/master.svg)](https://codecov.io/gh/Cosium/spring-data-jpa-entity-graph) [![Maven Central](https://img.shields.io/maven-central/v/com.cosium.spring.data/spring-data-jpa-entity-graph.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.cosium.spring.data%22%20AND%20a%3A%22spring-data-jpa-entity-graph%22) From 2b9b9ef25add1235f4606bc0c9ec48a9d79a7550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Fri, 17 Mar 2017 09:34:26 +0100 Subject: [PATCH 07/27] Make it clear that it is possible to use a Spring Data usual repository in addition to the ones provided by the extension. (cherry picked from commit ce2b525) --- README.md | 4 +- .../graph/repository/BasicRepositoryTest.java | 49 +++++++++++++++++++ .../graph/repository/sample/Country.java | 36 ++++++++++++++ .../entity/graph/repository/sample/Maker.java | 18 +++++++ .../repository/sample/MakerRepository.java | 17 +++++++ .../spring/data/jpa/entity/graph/dataset.xml | 4 +- 6 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/BasicRepositoryTest.java create mode 100644 src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/Country.java create mode 100644 src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/MakerRepository.java diff --git a/README.md b/README.md index 9e85e15..571ca37 100644 --- a/README.md +++ b/README.md @@ -44,10 +44,10 @@ Example: if you were using `spring-data-jpa 1.10.13` in your project, you would @Configuration @EnableJpaRepositories(repositoryFactoryBeanClass = JpaEntityGraphRepositoryFactoryBean.class) public class DataRepositoryConfiguration { - ... + //... } ``` -4. Make sure your repositories extend `JpaEntityGraphRepository`, `JpaEntityGraphSpecificationExecutor` and/or `JpaEntityGraphQueryDslPredicateExecutor` +4. Make sure your repositories extend the Spring Data usual ones or the extension provided repositories: `JpaEntityGraphRepository`, `JpaEntityGraphSpecificationExecutor` and/or `JpaEntityGraphQueryDslPredicateExecutor`. ## Basic Usage diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/BasicRepositoryTest.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/BasicRepositoryTest.java new file mode 100644 index 0000000..b043595 --- /dev/null +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/BasicRepositoryTest.java @@ -0,0 +1,49 @@ +package com.cosium.spring.data.jpa.entity.graph.repository; + +import static org.assertj.core.api.Assertions.*; + +import javax.inject.Inject; +import java.util.List; + +import com.cosium.spring.data.jpa.entity.graph.BaseTest; +import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraphUtils; +import com.cosium.spring.data.jpa.entity.graph.repository.sample.Maker; +import com.cosium.spring.data.jpa.entity.graph.repository.sample.MakerRepository; +import com.github.springtestdbunit.annotation.DatabaseSetup; +import com.github.springtestdbunit.annotation.DatabaseTearDown; +import org.hibernate.Hibernate; +import org.junit.Test; +import org.springframework.transaction.annotation.Transactional; + +/** + * Created on 17/03/17. + * + * @author Reda.Housni-Alaoui + */ +@DatabaseSetup(BaseTest.DATASET) +@DatabaseTearDown +public class BasicRepositoryTest extends BaseTest { + + @Inject + private MakerRepository makerRepository; + + @Transactional + @Test + public void given_empty_eg_when_finding_makers_then_country_should_not_be_initialized() { + List makers = makerRepository.findByName("Maker 1", EntityGraphUtils.empty()); + assertThat(makers).isNotEmpty(); + for (Maker maker : makers) { + assertThat(Hibernate.isInitialized(maker.getCountry())).isFalse(); + } + } + + @Transactional + @Test + public void given_country_eg_when_finding_makers_then_country_should_be_initialized() { + List makers = makerRepository.findByName("Maker 1", EntityGraphUtils.fromName(Maker.COUNTRY_EG)); + assertThat(makers).isNotEmpty(); + for (Maker maker : makers) { + assertThat(Hibernate.isInitialized(maker.getCountry())).isTrue(); + } + } +} diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/Country.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/Country.java new file mode 100644 index 0000000..de87850 --- /dev/null +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/Country.java @@ -0,0 +1,36 @@ +package com.cosium.spring.data.jpa.entity.graph.repository.sample; + +import javax.persistence.*; + +/** + * Created on 17/03/17. + * + * @author Reda.Housni-Alaoui + */ +@Entity +public class Country { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Access(value = AccessType.PROPERTY) + private long id = 0; + + private String name; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/Maker.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/Maker.java index 3cf877a..0516c77 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/Maker.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/Maker.java @@ -7,8 +7,14 @@ * * @author Reda.Housni-Alaoui */ +@NamedEntityGraphs({ + @NamedEntityGraph(name = Maker.COUNTRY_EG, attributeNodes = {@NamedAttributeNode("country")}) +}) @Entity public class Maker { + + public static final String COUNTRY_EG = "Marker.country"; + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Access(value = AccessType.PROPERTY) @@ -16,6 +22,10 @@ public class Maker { private String name; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(nullable = false) + private Country country; + public long getId() { return id; } @@ -31,4 +41,12 @@ public String getName() { public void setName(String name) { this.name = name; } + + public Country getCountry() { + return country; + } + + public void setCountry(Country country) { + this.country = country; + } } diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/MakerRepository.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/MakerRepository.java new file mode 100644 index 0000000..57c22eb --- /dev/null +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/MakerRepository.java @@ -0,0 +1,17 @@ +package com.cosium.spring.data.jpa.entity.graph.repository.sample; + +import java.util.List; + +import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; +import org.springframework.data.repository.Repository; + +/** + * Created on 17/03/17. + * + * @author Reda.Housni-Alaoui + */ +public interface MakerRepository extends Repository { + + List findByName(String name, EntityGraph entityGraph); + +} diff --git a/src/test/resources/com/cosium/spring/data/jpa/entity/graph/dataset.xml b/src/test/resources/com/cosium/spring/data/jpa/entity/graph/dataset.xml index a26fb53..c93b7ec 100644 --- a/src/test/resources/com/cosium/spring/data/jpa/entity/graph/dataset.xml +++ b/src/test/resources/com/cosium/spring/data/jpa/entity/graph/dataset.xml @@ -3,7 +3,9 @@ - + + + From 1e141c6f21382315d1360570cd11a61ec7951d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Fri, 17 Mar 2017 09:41:04 +0100 Subject: [PATCH 08/27] Correct broken ## Basic Usage (cherry picked from commit f3fdbf2) --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 571ca37..1afea6d 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,10 @@ Example: if you were using `spring-data-jpa 1.10.13` in your project, you would //... } ``` -4. Make sure your repositories extend the Spring Data usual ones or the extension provided repositories: `JpaEntityGraphRepository`, `JpaEntityGraphSpecificationExecutor` and/or `JpaEntityGraphQueryDslPredicateExecutor`. +4. Make sure your repositories extend the Spring Data usual ones or the extension provided repositories: +`JpaEntityGraphRepository`, `JpaEntityGraphSpecificationExecutor` and/or `JpaEntityGraphQueryDslPredicateExecutor` -## Basic Usage +## Basic Usage Let's consider the following entities and repository : ```java From 5c2b742f3e7f103aefaee42643cd3dceb2421ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sat, 18 Mar 2017 13:10:19 +0100 Subject: [PATCH 09/27] Fix #7 Allow usage of smallest repository interfaces (cherry picked from commit b4c6f77) --- README.md | 15 ++- .../entity/graph/domain/EntityGraphUtils.java | 4 +- .../repository/EntityGraphCrudRepository.java | 44 ++++++++ .../repository/EntityGraphJpaRepository.java | 18 ++++ .../EntityGraphJpaSpecificationExecutor.java | 59 +++++++++++ ...EntityGraphPagingAndSortingRepository.java | 40 +++++++ .../EntityGraphQueryByExampleExecutor.java | 62 +++++++++++ .../EntityGraphQueryDslPredicateExecutor.java | 84 +++++++++++++++ ...aEntityGraphQueryDslPredicateExecutor.java | 77 +------------- .../repository/JpaEntityGraphRepository.java | 100 +----------------- .../JpaEntityGraphSpecificationExecutor.java | 52 +-------- ...a => EntityGraphJpaRepositoryFactory.java} | 10 +- .../EntityGraphJpaRepositoryFactoryBean.java | 39 +++++++ ...va => EntityGraphSimpleJpaRepository.java} | 12 +-- .../JpaEntityGraphRepositoryFactoryBean.java | 25 +---- ...ava => QueryDslEntityGraphRepository.java} | 12 +-- .../data/jpa/entity/graph/BaseTest.java | 2 - .../graph/DataRepositoryConfiguration.java | 4 +- ...> EntityGraphCustomJpaRepositoryTest.java} | 5 +- ...java => EntityGraphJpaRepositoryTest.java} | 3 +- ...ityGraphJpaSpecificationExecutorTest.java} | 2 +- ...tyGraphQueryDslPredicateExecutorTest.java} | 2 +- ...epositoryTest.java => RepositoryTest.java} | 2 +- .../repository/sample/BrandRepository.java | 4 +- .../repository/sample/ProductRepository.java | 12 +-- 25 files changed, 409 insertions(+), 280 deletions(-) create mode 100644 src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphCrudRepository.java create mode 100644 src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaRepository.java create mode 100644 src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaSpecificationExecutor.java create mode 100644 src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphPagingAndSortingRepository.java create mode 100644 src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryByExampleExecutor.java create mode 100644 src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryDslPredicateExecutor.java rename src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/{JpaEntityGraphRepositoryFactory.java => EntityGraphJpaRepositoryFactory.java} (89%) create mode 100644 src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactoryBean.java rename src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/{SimpleJpaEntityGraphRepository.java => EntityGraphSimpleJpaRepository.java} (85%) rename src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/{QueryDslJpaEntityGraphRepository.java => QueryDslEntityGraphRepository.java} (85%) rename src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/{JpaEntityGraphCustomRepositoryTest.java => EntityGraphCustomJpaRepositoryTest.java} (92%) rename src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/{JpaEntityGraphRepositoryTest.java => EntityGraphJpaRepositoryTest.java} (99%) rename src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/{JpaEntityGraphSpecificationExecutorTest.java => EntityGraphJpaSpecificationExecutorTest.java} (98%) rename src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/{JpaEntityGraphQueryDslPredicateExecutorTest.java => EntityGraphQueryDslPredicateExecutorTest.java} (96%) rename src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/{BasicRepositoryTest.java => RepositoryTest.java} (96%) diff --git a/README.md b/README.md index 1afea6d..5f2f1e3 100644 --- a/README.md +++ b/README.md @@ -38,17 +38,22 @@ Example: if you were using `spring-data-jpa 1.10.13` in your project, you would ${spring-data-jpa-entity-graph.version} ``` -3. In your Spring configuration, set the repository factory bean class to `JpaEntityGraphRepositoryFactoryBean` : +3. In your Spring configuration, set the repository factory bean class to `EntityGraphJpaRepositoryFactoryBean` : ```java @Configuration - @EnableJpaRepositories(repositoryFactoryBeanClass = JpaEntityGraphRepositoryFactoryBean.class) + @EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class) public class DataRepositoryConfiguration { //... } ``` -4. Make sure your repositories extend the Spring Data usual ones or the extension provided repositories: -`JpaEntityGraphRepository`, `JpaEntityGraphSpecificationExecutor` and/or `JpaEntityGraphQueryDslPredicateExecutor` +4. Make sure your repositories extend the Spring Data standard ones or the library provided repositories: +- `EntityGraphJpaRepository` which is equivalent to standard `JpaRepository` +- `EntityGraphJpaSpecificationExecutor` which is equivalent to standard `JpaSpecificationExecutor` +- `EntityGraphQueryDslPredicateExecutor` which is equivalent to standard `QueryDslPredicateExecutor` +- `EntityGraphCrudRepository` which is equivalent to standard `CrudRepository` +- `EntityGraphPagingAndSortingRepository` which is equivalent to standard `PagingAndSortingRepository` +- `EntityGraphQueryByExampleExecutor` which is equivalent to standard `QueryByExampleExecutor` ## Basic Usage @@ -79,7 +84,7 @@ public class Product { } ``` ```java -public interface ProductRepository extends JpaEntityGraphRepository { +public interface ProductRepository extends EntityGraphJpaRepository { List findByName(String name, EntityGraph entityGraph); } ``` diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/domain/EntityGraphUtils.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/domain/EntityGraphUtils.java index 70a3718..db46eda 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/domain/EntityGraphUtils.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/domain/EntityGraphUtils.java @@ -1,10 +1,10 @@ package com.cosium.spring.data.jpa.entity.graph.domain; -import com.mysema.commons.lang.Assert; - import java.util.Arrays; import java.util.List; +import com.mysema.commons.lang.Assert; + /** * Created on 22/11/16. * diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphCrudRepository.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphCrudRepository.java new file mode 100644 index 0000000..247fa0a --- /dev/null +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphCrudRepository.java @@ -0,0 +1,44 @@ +package com.cosium.spring.data.jpa.entity.graph.repository; + +import java.io.Serializable; +import java.util.List; + +import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.NoRepositoryBean; + +/** + * Created on 18/03/17. + * + * @author Reda.Housni-Alaoui + */ +@NoRepositoryBean +public interface EntityGraphCrudRepository extends CrudRepository{ + + /** + * Retrieves an entity by its id. + * + * @param id must not be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return the entity with the given id or {@literal null} if none found + * @throws IllegalArgumentException if {@code id} is {@literal null} + */ + T findOne(ID id, EntityGraph entityGraph); + + /** + * Returns all instances of the type with the given IDs. + * + * @param ids + * @param entityGraph can be {@literal null}. + * @return + */ + List findAll(Iterable ids, EntityGraph entityGraph); + + /** + * Returns all instances of the type. + * + * @param entityGraph can be {@literal null}. + * @return all entities + */ + List findAll(EntityGraph entityGraph); +} diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaRepository.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaRepository.java new file mode 100644 index 0000000..4e4d6fb --- /dev/null +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaRepository.java @@ -0,0 +1,18 @@ +package com.cosium.spring.data.jpa.entity.graph.repository; + +import java.io.Serializable; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.repository.NoRepositoryBean; + +/** + * Created on 22/11/16. + * + * @author Reda.Housni-Alaoui + */ +@NoRepositoryBean +public interface EntityGraphJpaRepository + extends JpaRepository, EntityGraphPagingAndSortingRepository, EntityGraphQueryByExampleExecutor { + + +} diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaSpecificationExecutor.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaSpecificationExecutor.java new file mode 100644 index 0000000..a081fde --- /dev/null +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaSpecificationExecutor.java @@ -0,0 +1,59 @@ +package com.cosium.spring.data.jpa.entity.graph.repository; + +import java.util.List; + +import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.NoRepositoryBean; + +/** + * Created on 23/11/16. + * + * @author Reda.Housni-Alaoui + */ +@NoRepositoryBean +public interface EntityGraphJpaSpecificationExecutor extends JpaSpecificationExecutor { + + /** + * Returns a single entity matching the given {@link Specification}. + * + * @param spec + * @param entityGraph + * @return + */ + T findOne(Specification spec, EntityGraph entityGraph); + + /** + * Returns all entities matching the given {@link Specification}. + * + * @param spec + * @param entityGraph + * @return + */ + List findAll(Specification spec, EntityGraph entityGraph); + + /** + * Returns a {@link Page} of entities matching the given {@link Specification}. + * + * @param spec + * @param pageable + * @param entityGraph + * @return + */ + Page findAll(Specification spec, Pageable pageable, EntityGraph entityGraph); + + /** + * Returns all entities matching the given {@link Specification} and {@link Sort}. + * + * @param spec + * @param sort + * @param entityGraph + * @return + */ + List findAll(Specification spec, Sort sort, EntityGraph entityGraph); + +} diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphPagingAndSortingRepository.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphPagingAndSortingRepository.java new file mode 100644 index 0000000..89cb668 --- /dev/null +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphPagingAndSortingRepository.java @@ -0,0 +1,40 @@ +package com.cosium.spring.data.jpa.entity.graph.repository; + +import java.io.Serializable; +import java.util.List; + +import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.repository.NoRepositoryBean; +import org.springframework.data.repository.PagingAndSortingRepository; + +/** + * Created on 18/03/17. + * + * @author Reda.Housni-Alaoui + */ +@NoRepositoryBean +public interface EntityGraphPagingAndSortingRepository + extends PagingAndSortingRepository, EntityGraphCrudRepository { + + /** + * Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object. + * + * @param pageable + * @param entityGraph can be {@literal null}. + * @return a page of entities + */ + Page findAll(Pageable pageable, EntityGraph entityGraph); + + /** + * Returns all entities sorted by the given options. + * + * @param sort + * @param entityGraph can be {@literal null}. + * @return all entities sorted by the given options + */ + List findAll(Sort sort, EntityGraph entityGraph); + +} diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryByExampleExecutor.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryByExampleExecutor.java new file mode 100644 index 0000000..8bb8701 --- /dev/null +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryByExampleExecutor.java @@ -0,0 +1,62 @@ +package com.cosium.spring.data.jpa.entity.graph.repository; + +import java.util.List; + +import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; +import org.springframework.data.domain.Example; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.repository.NoRepositoryBean; +import org.springframework.data.repository.query.QueryByExampleExecutor; + +/** + * Created on 18/03/17. + * + * @author Reda.Housni-Alaoui + */ +@NoRepositoryBean +public interface EntityGraphQueryByExampleExecutor extends QueryByExampleExecutor { + + /** + * Returns a {@link Page} of entities matching the given {@link Example}. In case no match could be found, an empty + * {@link Page} is returned. + * + * @param example can be {@literal null}. + * @param pageable can be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return a {@link Page} of entities matching the given {@link Example}. + */ + Page findAll(Example example, Pageable pageable, EntityGraph entityGraph); + + /** + * Returns a single entity matching the given {@link Example} or {@literal null} if none was found. + * + * @param example can be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return a single entity matching the given {@link Example} or {@literal null} if none was found. + * @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the Example yields more than one result. + */ + S findOne(Example example, EntityGraph entityGraph); + + /** + * Returns all entities matching the given {@link Example} applying the given {@link Sort}. In case no match could be + * found an empty {@link Iterable} is returned. + * + * @param example can be {@literal null}. + * @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return all entities matching the given {@link Example}. + */ + List findAll(Example example, Sort sort, EntityGraph entityGraph); + + /** + * Returns the number of instances matching the given {@link Example}. + * + * @param example the {@link Example} to count instances for, can be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return the number of instances matching the {@link Example}. + */ + List findAll(Example example, EntityGraph entityGraph); + +} diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryDslPredicateExecutor.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryDslPredicateExecutor.java new file mode 100644 index 0000000..31ed337 --- /dev/null +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryDslPredicateExecutor.java @@ -0,0 +1,84 @@ +package com.cosium.spring.data.jpa.entity.graph.repository; + +import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; +import com.querydsl.core.types.OrderSpecifier; +import com.querydsl.core.types.Predicate; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.querydsl.QueryDslPredicateExecutor; +import org.springframework.data.repository.NoRepositoryBean; + +/** + * Created on 23/11/16. + * + * @author Reda.Housni-Alaoui + */ +@NoRepositoryBean +public interface EntityGraphQueryDslPredicateExecutor extends QueryDslPredicateExecutor { + + /** + * Returns a single entity matching the given {@link Predicate} or {@literal null} if none was found. + * + * @param predicate can be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return a single entity matching the given {@link Predicate} or {@literal null} if none was found. + * @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the predicate yields more than one + * result. + */ + T findOne(Predicate predicate, EntityGraph entityGraph); + + /** + * Returns all entities matching the given {@link Predicate}. In case no match could be found an empty + * {@link Iterable} is returned. + * + * @param predicate can be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return all entities matching the given {@link Predicate}. + */ + Iterable findAll(Predicate predicate, EntityGraph entityGraph); + + /** + * Returns all entities matching the given {@link Predicate} applying the given {@link Sort}. In case no match could + * be found an empty {@link Iterable} is returned. + * + * @param predicate can be {@literal null}. + * @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return all entities matching the given {@link Predicate}. + * @since 1.10 + */ + Iterable findAll(Predicate predicate, Sort sort, EntityGraph entityGraph); + + /** + * Returns all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s. In case no + * match could be found an empty {@link Iterable} is returned. + * + * @param predicate can be {@literal null}. + * @param entityGraph can be {@literal null}. + * @param orders the {@link OrderSpecifier}s to sort the results by + * @return all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s. + */ + Iterable findAll(Predicate predicate, EntityGraph entityGraph, OrderSpecifier... orders); + + /** + * Returns all entities ordered by the given {@link OrderSpecifier}s. + * + * @param orders the {@link OrderSpecifier}s to sort the results by. + * @param entityGraph can be {@literal null}. + * @return all entities ordered by the given {@link OrderSpecifier}s. + */ + Iterable findAll(EntityGraph entityGraph, OrderSpecifier... orders); + + /** + * Returns a {@link Page} of entities matching the given {@link Predicate}. In case no match could be found, an empty + * {@link Page} is returned. + * + * @param predicate can be {@literal null}. + * @param pageable can be {@literal null}. + * @param entityGraph can be {@literal null}. + * @return a {@link Page} of entities matching the given {@link Predicate}. + */ + Page findAll(Predicate predicate, Pageable pageable, EntityGraph entityGraph); + +} diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphQueryDslPredicateExecutor.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphQueryDslPredicateExecutor.java index d28cc0a..2578c85 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphQueryDslPredicateExecutor.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphQueryDslPredicateExecutor.java @@ -1,82 +1,15 @@ package com.cosium.spring.data.jpa.entity.graph.repository; -import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; -import com.querydsl.core.types.OrderSpecifier; -import com.querydsl.core.types.Predicate; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; -import org.springframework.data.querydsl.QueryDslPredicateExecutor; +import org.springframework.data.repository.NoRepositoryBean; /** * Created on 23/11/16. * * @author Reda.Housni-Alaoui + * @deprecated Use {@link EntityGraphQueryDslPredicateExecutor} instead */ -public interface JpaEntityGraphQueryDslPredicateExecutor extends QueryDslPredicateExecutor { - - /** - * Returns a single entity matching the given {@link Predicate} or {@literal null} if none was found. - * - * @param predicate can be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return a single entity matching the given {@link Predicate} or {@literal null} if none was found. - * @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the predicate yields more than one - * result. - */ - T findOne(Predicate predicate, EntityGraph entityGraph); - - /** - * Returns all entities matching the given {@link Predicate}. In case no match could be found an empty - * {@link Iterable} is returned. - * - * @param predicate can be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return all entities matching the given {@link Predicate}. - */ - Iterable findAll(Predicate predicate, EntityGraph entityGraph); - - /** - * Returns all entities matching the given {@link Predicate} applying the given {@link Sort}. In case no match could - * be found an empty {@link Iterable} is returned. - * - * @param predicate can be {@literal null}. - * @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return all entities matching the given {@link Predicate}. - * @since 1.10 - */ - Iterable findAll(Predicate predicate, Sort sort, EntityGraph entityGraph); - - /** - * Returns all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s. In case no - * match could be found an empty {@link Iterable} is returned. - * - * @param predicate can be {@literal null}. - * @param entityGraph can be {@literal null}. - * @param orders the {@link OrderSpecifier}s to sort the results by - * @return all entities matching the given {@link Predicate} applying the given {@link OrderSpecifier}s. - */ - Iterable findAll(Predicate predicate, EntityGraph entityGraph, OrderSpecifier... orders); - - /** - * Returns all entities ordered by the given {@link OrderSpecifier}s. - * - * @param orders the {@link OrderSpecifier}s to sort the results by. - * @param entityGraph can be {@literal null}. - * @return all entities ordered by the given {@link OrderSpecifier}s. - */ - Iterable findAll(EntityGraph entityGraph, OrderSpecifier... orders); - - /** - * Returns a {@link Page} of entities matching the given {@link Predicate}. In case no match could be found, an empty - * {@link Page} is returned. - * - * @param predicate can be {@literal null}. - * @param pageable can be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return a {@link Page} of entities matching the given {@link Predicate}. - */ - Page findAll(Predicate predicate, Pageable pageable, EntityGraph entityGraph); +@Deprecated +@NoRepositoryBean +public interface JpaEntityGraphQueryDslPredicateExecutor extends EntityGraphQueryDslPredicateExecutor{ } diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphRepository.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphRepository.java index 895a79c..7b13241 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphRepository.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphRepository.java @@ -1,109 +1,17 @@ package com.cosium.spring.data.jpa.entity.graph.repository; import java.io.Serializable; -import java.util.List; -import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; -import org.springframework.data.domain.Example; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; -import org.springframework.data.jpa.domain.Specification; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.repository.NoRepositoryBean; /** - * Created on 22/11/16. + * Created on 23/11/16. * * @author Reda.Housni-Alaoui + * @deprecated Use {@link EntityGraphJpaRepository} instead */ +@Deprecated @NoRepositoryBean -public interface JpaEntityGraphRepository extends JpaRepository { +public interface JpaEntityGraphRepository extends EntityGraphJpaRepository{ - /** - * Returns a {@link Page} of entities matching the given {@link Example}. In case no match could be found, an empty - * {@link Page} is returned. - * - * @param example can be {@literal null}. - * @param pageable can be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return a {@link Page} of entities matching the given {@link Example}. - */ - Page findAll(Example example, Pageable pageable, EntityGraph entityGraph); - - /** - * Returns a single entity matching the given {@link Example} or {@literal null} if none was found. - * - * @param example can be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return a single entity matching the given {@link Example} or {@literal null} if none was found. - * @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the Example yields more than one result. - */ - S findOne(Example example, EntityGraph entityGraph); - - /** - * Retrieves an entity by its id. - * - * @param id must not be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return the entity with the given id or {@literal null} if none found - * @throws IllegalArgumentException if {@code id} is {@literal null} - */ - T findOne(ID id, EntityGraph entityGraph); - - /** - * Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object. - * - * @param pageable - * @param entityGraph can be {@literal null}. - * @return a page of entities - */ - Page findAll(Pageable pageable, EntityGraph entityGraph); - - /** - * Returns all entities matching the given {@link Example} applying the given {@link Sort}. In case no match could be - * found an empty {@link Iterable} is returned. - * - * @param example can be {@literal null}. - * @param sort the {@link Sort} specification to sort the results by, must not be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return all entities matching the given {@link Example}. - */ - List findAll(Example example, Sort sort, EntityGraph entityGraph); - - /** - * Returns the number of instances matching the given {@link Example}. - * - * @param example the {@link Example} to count instances for, can be {@literal null}. - * @param entityGraph can be {@literal null}. - * @return the number of instances matching the {@link Example}. - */ - List findAll(Example example, EntityGraph entityGraph); - - /** - * Returns all instances of the type with the given IDs. - * - * @param ids - * @param entityGraph can be {@literal null}. - * @return - */ - List findAll(Iterable ids, EntityGraph entityGraph); - - /** - * Returns all entities sorted by the given options. - * - * @param sort - * @param entityGraph can be {@literal null}. - * @return all entities sorted by the given options - */ - List findAll(Sort sort, EntityGraph entityGraph); - - /** - * Returns all instances of the type. - * - * @param entityGraph can be {@literal null}. - * @return all entities - */ - List findAll(EntityGraph entityGraph); } diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphSpecificationExecutor.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphSpecificationExecutor.java index b645031..63858f7 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphSpecificationExecutor.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphSpecificationExecutor.java @@ -1,57 +1,15 @@ package com.cosium.spring.data.jpa.entity.graph.repository; -import java.util.List; - -import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; -import org.springframework.data.jpa.domain.Specification; -import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.repository.NoRepositoryBean; /** * Created on 23/11/16. * * @author Reda.Housni-Alaoui + * @deprecated Use {@link EntityGraphJpaSpecificationExecutor} instead */ -public interface JpaEntityGraphSpecificationExecutor extends JpaSpecificationExecutor { - - /** - * Returns a single entity matching the given {@link Specification}. - * - * @param spec - * @param entityGraph - * @return - */ - T findOne(Specification spec, EntityGraph entityGraph); - - /** - * Returns all entities matching the given {@link Specification}. - * - * @param spec - * @param entityGraph - * @return - */ - List findAll(Specification spec, EntityGraph entityGraph); - - /** - * Returns a {@link Page} of entities matching the given {@link Specification}. - * - * @param spec - * @param pageable - * @param entityGraph - * @return - */ - Page findAll(Specification spec, Pageable pageable, EntityGraph entityGraph); - - /** - * Returns all entities matching the given {@link Specification} and {@link Sort}. - * - * @param spec - * @param sort - * @param entityGraph - * @return - */ - List findAll(Specification spec, Sort sort, EntityGraph entityGraph); +@Deprecated +@NoRepositoryBean +public interface JpaEntityGraphSpecificationExecutor extends EntityGraphJpaSpecificationExecutor { } diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/JpaEntityGraphRepositoryFactory.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactory.java similarity index 89% rename from src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/JpaEntityGraphRepositoryFactory.java rename to src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactory.java index b93f684..11727ad 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/JpaEntityGraphRepositoryFactory.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactory.java @@ -1,6 +1,6 @@ package com.cosium.spring.data.jpa.entity.graph.repository.support; -import static org.springframework.data.querydsl.QueryDslUtils.QUERY_DSL_PRESENT; +import static org.springframework.data.querydsl.QueryDslUtils.*; import javax.persistence.EntityManager; import java.lang.reflect.Field; @@ -22,7 +22,7 @@ * * @author Reda.Housni-Alaoui */ -public class JpaEntityGraphRepositoryFactory extends JpaRepositoryFactory { +class EntityGraphJpaRepositoryFactory extends JpaRepositoryFactory { static { addEntityGraphToSpecialTypes(); @@ -59,7 +59,7 @@ private static void addEntityGraphToSpecialTypes(Class clazz, String fieldNam * * @param entityManager must not be {@literal null} */ - public JpaEntityGraphRepositoryFactory(EntityManager entityManager) { + public EntityGraphJpaRepositoryFactory(EntityManager entityManager) { super(entityManager); addRepositoryProxyPostProcessor(new RepositoryMethodEntityGraphExtractor(entityManager)); } @@ -67,9 +67,9 @@ public JpaEntityGraphRepositoryFactory(EntityManager entityManager) { @Override protected Class getRepositoryBaseClass(RepositoryMetadata metadata) { if (isQueryDslExecutor(metadata.getRepositoryInterface())) { - return QueryDslJpaEntityGraphRepository.class; + return QueryDslEntityGraphRepository.class; } else { - return SimpleJpaEntityGraphRepository.class; + return EntityGraphSimpleJpaRepository.class; } } diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactoryBean.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactoryBean.java new file mode 100644 index 0000000..1ab03a4 --- /dev/null +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactoryBean.java @@ -0,0 +1,39 @@ +package com.cosium.spring.data.jpa.entity.graph.repository.support; + +import javax.persistence.EntityManager; +import java.io.Serializable; + +import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean; +import org.springframework.data.repository.Repository; +import org.springframework.data.repository.core.support.RepositoryFactorySupport; + +/** + * Forces the use of {@link RepositoryEntityManagerEntityGraphInjector} while targeting {@link EntityGraphJpaRepositoryFactory}. + * + * Created on 18/03/17. + * + * @author Reda.Housni-Alaoui + */ +public class EntityGraphJpaRepositoryFactoryBean, T, I extends Serializable> + extends JpaRepositoryFactoryBean { + + /** + * Creates a new {@link JpaRepositoryFactoryBean} for the given repository interface. + * + * @param repositoryInterface must not be {@literal null}. + */ + public EntityGraphJpaRepositoryFactoryBean(Class repositoryInterface) { + super(repositoryInterface); + } + + @Override + public void setEntityManager(EntityManager entityManager) { + /* Make sure to use the EntityManager able to inject captured EntityGraphs */ + super.setEntityManager(RepositoryEntityManagerEntityGraphInjector.proxy(entityManager)); + } + + @Override + protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) { + return new EntityGraphJpaRepositoryFactory(entityManager); + } +} diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/SimpleJpaEntityGraphRepository.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphSimpleJpaRepository.java similarity index 85% rename from src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/SimpleJpaEntityGraphRepository.java rename to src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphSimpleJpaRepository.java index 098ebeb..24b1ff3 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/SimpleJpaEntityGraphRepository.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphSimpleJpaRepository.java @@ -5,8 +5,8 @@ import java.util.List; import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; -import com.cosium.spring.data.jpa.entity.graph.repository.JpaEntityGraphRepository; -import com.cosium.spring.data.jpa.entity.graph.repository.JpaEntityGraphSpecificationExecutor; +import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaRepository; +import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaSpecificationExecutor; import org.springframework.data.domain.Example; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -22,15 +22,15 @@ * * @author Reda.Housni-Alaoui */ -public class SimpleJpaEntityGraphRepository +class EntityGraphSimpleJpaRepository extends SimpleJpaRepository - implements JpaEntityGraphRepository, JpaEntityGraphSpecificationExecutor { + implements EntityGraphJpaRepository, EntityGraphJpaSpecificationExecutor { - public SimpleJpaEntityGraphRepository(JpaEntityInformation entityInformation, EntityManager entityManager) { + public EntityGraphSimpleJpaRepository(JpaEntityInformation entityInformation, EntityManager entityManager) { super(entityInformation, entityManager); } - public SimpleJpaEntityGraphRepository(Class domainClass, EntityManager em) { + public EntityGraphSimpleJpaRepository(Class domainClass, EntityManager em) { super(domainClass, em); } diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/JpaEntityGraphRepositoryFactoryBean.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/JpaEntityGraphRepositoryFactoryBean.java index eb5c942..172d70e 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/JpaEntityGraphRepositoryFactoryBean.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/JpaEntityGraphRepositoryFactoryBean.java @@ -1,40 +1,23 @@ package com.cosium.spring.data.jpa.entity.graph.repository.support; -import javax.persistence.EntityManager; import java.io.Serializable; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean; import org.springframework.data.repository.Repository; -import org.springframework.data.repository.core.support.RepositoryFactorySupport; /** - * Forces the use of {@link RepositoryEntityManagerEntityGraphInjector} while targeting {@link JpaEntityGraphRepositoryFactory}. + * Forces the use of {@link RepositoryEntityManagerEntityGraphInjector} while targeting {@link EntityGraphJpaRepositoryFactory}. * * Created on 22/11/16. * * @author Reda.Housni-Alaoui + * @deprecated Use {@link EntityGraphJpaRepositoryFactoryBean} instead */ +@Deprecated public class JpaEntityGraphRepositoryFactoryBean, T, I extends Serializable> - extends JpaRepositoryFactoryBean{ + extends EntityGraphJpaRepositoryFactoryBean{ - /** - * Creates a new {@link JpaRepositoryFactoryBean} for the given repository interface. - * - * @param repositoryInterface must not be {@literal null}. - */ public JpaEntityGraphRepositoryFactoryBean(Class repositoryInterface) { super(repositoryInterface); } - @Override - public void setEntityManager(EntityManager entityManager) { - /* Make sure to use the EntityManager able to inject captured EntityGraphs */ - super.setEntityManager(RepositoryEntityManagerEntityGraphInjector.proxy(entityManager)); - } - - @Override - protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) { - return new JpaEntityGraphRepositoryFactory(entityManager); - } } diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslJpaEntityGraphRepository.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslEntityGraphRepository.java similarity index 85% rename from src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslJpaEntityGraphRepository.java rename to src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslEntityGraphRepository.java index ff98722..fe605f0 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslJpaEntityGraphRepository.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslEntityGraphRepository.java @@ -4,7 +4,7 @@ import java.io.Serializable; import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; -import com.cosium.spring.data.jpa.entity.graph.repository.JpaEntityGraphQueryDslPredicateExecutor; +import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphQueryDslPredicateExecutor; import com.querydsl.core.types.OrderSpecifier; import com.querydsl.core.types.Predicate; import org.springframework.data.domain.Page; @@ -21,18 +21,18 @@ * * @author Reda.Housni-Alaoui */ -public class QueryDslJpaEntityGraphRepository - extends SimpleJpaEntityGraphRepository implements JpaEntityGraphQueryDslPredicateExecutor { +class QueryDslEntityGraphRepository + extends EntityGraphSimpleJpaRepository implements EntityGraphQueryDslPredicateExecutor { private QueryDslJpaRepository queryDslJpaRepositoryDelegate; - public QueryDslJpaEntityGraphRepository(JpaEntityInformation entityInformation, EntityManager entityManager) { + public QueryDslEntityGraphRepository(JpaEntityInformation entityInformation, EntityManager entityManager) { super(entityInformation, entityManager); this.queryDslJpaRepositoryDelegate = new EntityGraphAwareQueryDslJpaRepository((JpaEntityInformation) entityInformation, entityManager); } - public QueryDslJpaEntityGraphRepository(JpaEntityInformation entityInformation, EntityManager entityManager, - EntityPathResolver resolver) { + public QueryDslEntityGraphRepository(JpaEntityInformation entityInformation, EntityManager entityManager, + EntityPathResolver resolver) { super(entityInformation, entityManager); this.queryDslJpaRepositoryDelegate = new EntityGraphAwareQueryDslJpaRepository(entityInformation, entityManager, resolver); } diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/BaseTest.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/BaseTest.java index ab538bd..000070b 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/BaseTest.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/BaseTest.java @@ -1,8 +1,6 @@ package com.cosium.spring.data.jpa.entity.graph; import com.github.springtestdbunit.DbUnitTestExecutionListener; -import com.github.springtestdbunit.annotation.DatabaseSetup; -import com.github.springtestdbunit.annotation.DatabaseTearDown; import org.junit.runner.RunWith; import org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa; import org.springframework.test.annotation.DirtiesContext; diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/DataRepositoryConfiguration.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/DataRepositoryConfiguration.java index ff5108f..fba7a6f 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/DataRepositoryConfiguration.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/DataRepositoryConfiguration.java @@ -1,6 +1,6 @@ package com.cosium.spring.data.jpa.entity.graph; -import com.cosium.spring.data.jpa.entity.graph.repository.support.JpaEntityGraphRepositoryFactoryBean; +import com.cosium.spring.data.jpa.entity.graph.repository.support.EntityGraphJpaRepositoryFactoryBean; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @@ -10,7 +10,7 @@ * @author Reda.Housni-Alaoui */ @Configuration -@EnableJpaRepositories(repositoryFactoryBeanClass = JpaEntityGraphRepositoryFactoryBean.class) +@EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class) public class DataRepositoryConfiguration { } diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphCustomRepositoryTest.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphCustomJpaRepositoryTest.java similarity index 92% rename from src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphCustomRepositoryTest.java rename to src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphCustomJpaRepositoryTest.java index 301e9d9..78dac73 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphCustomRepositoryTest.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphCustomJpaRepositoryTest.java @@ -1,9 +1,8 @@ package com.cosium.spring.data.jpa.entity.graph.repository; -import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.*; import javax.inject.Inject; - import java.util.List; import com.cosium.spring.data.jpa.entity.graph.BaseTest; @@ -23,7 +22,7 @@ */ @DatabaseSetup(BaseTest.DATASET) @DatabaseTearDown -public class JpaEntityGraphCustomRepositoryTest extends BaseTest { +public class EntityGraphCustomJpaRepositoryTest extends BaseTest { @Inject private ProductRepository productRepository; diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphRepositoryTest.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaRepositoryTest.java similarity index 99% rename from src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphRepositoryTest.java rename to src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaRepositoryTest.java index f90da23..a858250 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphRepositoryTest.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaRepositoryTest.java @@ -7,7 +7,6 @@ import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; - import java.util.List; import com.cosium.spring.data.jpa.entity.graph.BaseTest; @@ -30,7 +29,7 @@ */ @DatabaseSetup(BaseTest.DATASET) @DatabaseTearDown -public class JpaEntityGraphRepositoryTest extends BaseTest { +public class EntityGraphJpaRepositoryTest extends BaseTest { @Inject private ProductRepository productRepository; diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphSpecificationExecutorTest.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaSpecificationExecutorTest.java similarity index 98% rename from src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphSpecificationExecutorTest.java rename to src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaSpecificationExecutorTest.java index 57d7034..a20ec34 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphSpecificationExecutorTest.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphJpaSpecificationExecutorTest.java @@ -30,7 +30,7 @@ */ @DatabaseSetup(BaseTest.DATASET) @DatabaseTearDown -public class JpaEntityGraphSpecificationExecutorTest extends BaseTest { +public class EntityGraphJpaSpecificationExecutorTest extends BaseTest { @Inject private ProductRepository productRepository; diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphQueryDslPredicateExecutorTest.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryDslPredicateExecutorTest.java similarity index 96% rename from src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphQueryDslPredicateExecutorTest.java rename to src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryDslPredicateExecutorTest.java index 2bdaa1a..ce04506 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/JpaEntityGraphQueryDslPredicateExecutorTest.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/EntityGraphQueryDslPredicateExecutorTest.java @@ -26,7 +26,7 @@ */ @DatabaseSetup(BaseTest.DATASET) @DatabaseTearDown -public class JpaEntityGraphQueryDslPredicateExecutorTest extends BaseTest { +public class EntityGraphQueryDslPredicateExecutorTest extends BaseTest { @Inject private ProductRepository productRepository; diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/BasicRepositoryTest.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/RepositoryTest.java similarity index 96% rename from src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/BasicRepositoryTest.java rename to src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/RepositoryTest.java index b043595..5fb890a 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/BasicRepositoryTest.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/RepositoryTest.java @@ -22,7 +22,7 @@ */ @DatabaseSetup(BaseTest.DATASET) @DatabaseTearDown -public class BasicRepositoryTest extends BaseTest { +public class RepositoryTest extends BaseTest { @Inject private MakerRepository makerRepository; diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/BrandRepository.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/BrandRepository.java index c785f0a..6f1ff58 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/BrandRepository.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/BrandRepository.java @@ -1,12 +1,12 @@ package com.cosium.spring.data.jpa.entity.graph.repository.sample; -import com.cosium.spring.data.jpa.entity.graph.repository.JpaEntityGraphRepository; +import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaRepository; /** * Created on 24/11/16. * * @author Reda.Housni-Alaoui */ -public interface BrandRepository extends JpaEntityGraphRepository { +public interface BrandRepository extends EntityGraphJpaRepository { } diff --git a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/ProductRepository.java b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/ProductRepository.java index 721bb06..99d518a 100644 --- a/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/ProductRepository.java +++ b/src/test/java/com/cosium/spring/data/jpa/entity/graph/repository/sample/ProductRepository.java @@ -3,9 +3,9 @@ import java.util.List; import com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph; -import com.cosium.spring.data.jpa.entity.graph.repository.JpaEntityGraphQueryDslPredicateExecutor; -import com.cosium.spring.data.jpa.entity.graph.repository.JpaEntityGraphRepository; -import com.cosium.spring.data.jpa.entity.graph.repository.JpaEntityGraphSpecificationExecutor; +import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaRepository; +import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaSpecificationExecutor; +import com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphQueryDslPredicateExecutor; import org.springframework.data.jpa.repository.Query; /** @@ -14,9 +14,9 @@ * @author Reda.Housni-Alaoui */ public interface ProductRepository - extends JpaEntityGraphRepository, - JpaEntityGraphSpecificationExecutor, - JpaEntityGraphQueryDslPredicateExecutor, + extends EntityGraphJpaRepository, + EntityGraphJpaSpecificationExecutor, + EntityGraphQueryDslPredicateExecutor, ProductRepositoryCustom { List findByName(String name, EntityGraph entityGraph); From f1baec1863899f8557f21a816d1552b737b23978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sat, 18 Mar 2017 13:14:15 +0100 Subject: [PATCH 10/27] [maven-release-plugin] prepare release spring-data-jpa-entity-graph-1.11.01 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e638b77..795d71e 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.01-SNAPSHOT + 1.11.01 1.6 @@ -236,7 +236,7 @@ scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph https://github.com/Cosium/spring-data-jpa-entity-graph - HEAD + spring-data-jpa-entity-graph-1.11.01 From 599585cf6e552c580c7f6d6266782292149cf350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sat, 18 Mar 2017 13:14:15 +0100 Subject: [PATCH 11/27] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 795d71e..2189dde 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.01 + 1.11.02-SNAPSHOT 1.6 @@ -236,7 +236,7 @@ scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph https://github.com/Cosium/spring-data-jpa-entity-graph - spring-data-jpa-entity-graph-1.11.01 + HEAD From e95aec3e6c6da91d21b035e9fa37e4a576e976d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sat, 18 Mar 2017 13:16:25 +0100 Subject: [PATCH 12/27] Bump to 1.11.01 (cherry picked from commit 016de82) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f2f1e3..c27a542 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This library follows the Spring Data JPA versionning semantic. spring-data-jpa branches | spring-data-jpa-entity-graph.version ---------------------------- | --------------- 1.12.x | Not released yet -1.11.x | 1.11.00 +1.11.x | 1.11.01 1.10.x | 1.10.14 Example: if you were using `spring-data-jpa 1.10.13` in your project, you would need to select any `spring-data-jpa-entity-graph 1.10.x`. Thus `spring-data-jpa-entity-graph 1.10.14` would be eligible. From ee09f6d3765b1ff45c5004e63cbec82dafc5fd58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sat, 18 Mar 2017 13:31:58 +0100 Subject: [PATCH 13/27] Add redirection link to other branches documentation (cherry picked from commit bb6b018) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c27a542..ddfff12 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,15 @@ Example: productRepository.findByName("foo", EntityGraphUtils.fromName("Product.brand")); ``` -## Compatibility between spring-data-jpa and spring-data-jpa-entity-graph +## How to select the correct version This library follows the Spring Data JPA versionning semantic. -spring-data-jpa branches | spring-data-jpa-entity-graph.version ----------------------------- | --------------- -1.12.x | Not released yet -1.11.x | 1.11.01 -1.10.x | 1.10.14 +spring-data-jpa branches | spring-data-jpa-entity-graph.version | Documentation +---------------------------- | --------------- | ----------------- +1.12.x | Not released yet | [1.12.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/master/README.md) +1.11.x | 1.11.01 | Current one +1.10.x | 1.10.14 | [1.10.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/1.10.x/README.md) Example: if you were using `spring-data-jpa 1.10.13` in your project, you would need to select any `spring-data-jpa-entity-graph 1.10.x`. Thus `spring-data-jpa-entity-graph 1.10.14` would be eligible. From 2a439a25b64213a656fcd2e8ec88bf63157ba61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sat, 18 Mar 2017 13:57:31 +0100 Subject: [PATCH 14/27] Refactor documentation --- README.md | 124 ++-------------------------------------------------- doc/MAIN.md | 115 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 120 deletions(-) create mode 100644 doc/MAIN.md diff --git a/README.md b/README.md index ddfff12..59bf6ff 100644 --- a/README.md +++ b/README.md @@ -15,131 +15,15 @@ Example: productRepository.findByName("foo", EntityGraphUtils.fromName("Product.brand")); ``` -## How to select the correct version +## Documentation This library follows the Spring Data JPA versionning semantic. spring-data-jpa branches | spring-data-jpa-entity-graph.version | Documentation ---------------------------- | --------------- | ----------------- -1.12.x | Not released yet | [1.12.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/master/README.md) -1.11.x | 1.11.01 | Current one -1.10.x | 1.10.14 | [1.10.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/1.10.x/README.md) +1.12.x | Not released yet | [1.12.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/master/doc/MAIN.md) +1.11.x | 1.11.01 | [1.11.x documentation](doc/MAIN.md) +1.10.x | 1.10.14 | [1.10.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/1.10.x/doc/MAIN.md) Example: if you were using `spring-data-jpa 1.10.13` in your project, you would need to select any `spring-data-jpa-entity-graph 1.10.x`. Thus `spring-data-jpa-entity-graph 1.10.14` would be eligible. -## Quick start -1. Select the `spring-data-jpa-entity-graph.version` from the above compatibility table -2. In addition to `spring-data-jpa`, add the library dependency : - - ```xml - - com.cosium.spring.data - spring-data-jpa-entity-graph - ${spring-data-jpa-entity-graph.version} - - ``` -3. In your Spring configuration, set the repository factory bean class to `EntityGraphJpaRepositoryFactoryBean` : - - ```java - @Configuration - @EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class) - public class DataRepositoryConfiguration { - //... - } - ``` -4. Make sure your repositories extend the Spring Data standard ones or the library provided repositories: -- `EntityGraphJpaRepository` which is equivalent to standard `JpaRepository` -- `EntityGraphJpaSpecificationExecutor` which is equivalent to standard `JpaSpecificationExecutor` -- `EntityGraphQueryDslPredicateExecutor` which is equivalent to standard `QueryDslPredicateExecutor` -- `EntityGraphCrudRepository` which is equivalent to standard `CrudRepository` -- `EntityGraphPagingAndSortingRepository` which is equivalent to standard `PagingAndSortingRepository` -- `EntityGraphQueryByExampleExecutor` which is equivalent to standard `QueryByExampleExecutor` - -## Basic Usage - -Let's consider the following entities and repository : -```java -@Entity -public class Brand { - @Id - private long id = 0; - private String name; - //... -} -``` -```java -@NamedEntityGraphs(value = { - @NamedEntityGraph(name = "Product.brand", attributeNodes = { - @NamedAttributeNode("brand") - }) -}) -@Entity -public class Product { - @Id - private long id = 0; - private String name; - @ManyToOne(fetch = FetchType.LAZY) - private Brand brand; - //... -} -``` -```java -public interface ProductRepository extends EntityGraphJpaRepository { - List findByName(String name, EntityGraph entityGraph); -} -``` - -You can pass the entity graph to the `findByName` method : -```java -// This will apply 'Product.brand' named EntityGraph to findByName -productRepository.findByName("MyProduct", EntityGraphUtils.fromName("Product.brand")); -``` - -Or to the `findOne` method : -```java -// This will apply 'Product.brand' named EntityGraph to findOne -productRepository.findOne(1L, EntityGraphUtils.fromName("Product.brand")); -``` - -Or any method you like. - -You can also pass a dynamically built EntityGraph by using `DynamicEntityGraph`, it's also accessible through a helper method: - -```java -productRepository.findOne(1L, EntityGraphUtils.fromAttributePaths("brand", "maker")); -``` - -This is similar to [Spring's ad-hoc attribute paths](http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-property-expressions), -and equivalent to writing this in your repository's interface: -```java -@EntityGraph(attributePaths = { "brand", "maker" }) -Product findOne(Long id); -``` - -## Default EntityGraph - -For an Entity, you can define its default EntityGraph. -An Entity default EntityGraph will be used each time the Entity repository method is called without EntityGraph. - -A default EntityGraph name must end with `.default`. - -```java -@NamedEntityGraphs(value = { - @NamedEntityGraph(name = "Product.default", attributeNodes = { - @NamedAttributeNode("brand") - }) -}) -@Entity -public class Product { - @Id - private long id = 0; - private String name; - @ManyToOne(fetch = FetchType.LAZY) - private Brand brand; - //... -} -``` -```java -// This call will make use of "Product.default" EntityGraph. -productRepository.findOne(1L); -``` diff --git a/doc/MAIN.md b/doc/MAIN.md new file mode 100644 index 0000000..edc14cc --- /dev/null +++ b/doc/MAIN.md @@ -0,0 +1,115 @@ +## Quick start +1. In addition to `spring-data-jpa`, add the library dependency : + + ```xml + + com.cosium.spring.data + spring-data-jpa-entity-graph + 1.11.01 + + ``` +2. In your Spring configuration, set the repository factory bean class to `EntityGraphJpaRepositoryFactoryBean` : + + ```java + @Configuration + @EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class) + public class DataRepositoryConfiguration { + //... + } + ``` +3. Make sure your repositories extend the Spring Data standard ones or the library provided repositories: +- `EntityGraphJpaRepository` which is equivalent to standard `JpaRepository` +- `EntityGraphJpaSpecificationExecutor` which is equivalent to standard `JpaSpecificationExecutor` +- `EntityGraphQueryDslPredicateExecutor` which is equivalent to standard `QueryDslPredicateExecutor` +- `EntityGraphCrudRepository` which is equivalent to standard `CrudRepository` +- `EntityGraphPagingAndSortingRepository` which is equivalent to standard `PagingAndSortingRepository` +- `EntityGraphQueryByExampleExecutor` which is equivalent to standard `QueryByExampleExecutor` + +## Basic Usage + +Let's consider the following entities and repository : +```java +@Entity +public class Brand { + @Id + private long id = 0; + private String name; + //... +} +``` +```java +@NamedEntityGraphs(value = { + @NamedEntityGraph(name = "Product.brand", attributeNodes = { + @NamedAttributeNode("brand") + }) +}) +@Entity +public class Product { + @Id + private long id = 0; + private String name; + @ManyToOne(fetch = FetchType.LAZY) + private Brand brand; + //... +} +``` +```java +public interface ProductRepository extends EntityGraphJpaRepository { + List findByName(String name, EntityGraph entityGraph); +} +``` + +You can pass the entity graph to the `findByName` method : +```java +// This will apply 'Product.brand' named EntityGraph to findByName +productRepository.findByName("MyProduct", EntityGraphUtils.fromName("Product.brand")); +``` + +Or to the `findOne` method : +```java +// This will apply 'Product.brand' named EntityGraph to findOne +productRepository.findOne(1L, EntityGraphUtils.fromName("Product.brand")); +``` + +Or any method you like. + +You can also pass a dynamically built EntityGraph by using `DynamicEntityGraph`, it's also accessible through a helper method: + +```java +productRepository.findOne(1L, EntityGraphUtils.fromAttributePaths("brand", "maker")); +``` + +This is similar to [Spring's ad-hoc attribute paths](http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-methods.query-property-expressions), +and equivalent to writing this in your repository's interface: +```java +@EntityGraph(attributePaths = { "brand", "maker" }) +Product findOne(Long id); +``` + +## Default EntityGraph + +For an Entity, you can define its default EntityGraph. +An Entity default EntityGraph will be used each time the Entity repository method is called without EntityGraph. + +A default EntityGraph name must end with `.default`. + +```java +@NamedEntityGraphs(value = { + @NamedEntityGraph(name = "Product.default", attributeNodes = { + @NamedAttributeNode("brand") + }) +}) +@Entity +public class Product { + @Id + private long id = 0; + private String name; + @ManyToOne(fetch = FetchType.LAZY) + private Brand brand; + //... +} +``` +```java +// This call will make use of "Product.default" EntityGraph. +productRepository.findOne(1L); +``` From d8200dfca011f49a1eff5f2862af3ed5d173da86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sat, 18 Mar 2017 14:04:51 +0100 Subject: [PATCH 15/27] Change table --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59bf6ff..110e4e1 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ productRepository.findByName("foo", EntityGraphUtils.fromName("Product.brand")); This library follows the Spring Data JPA versionning semantic. -spring-data-jpa branches | spring-data-jpa-entity-graph.version | Documentation +spring-data-jpa branches | Latest spring-data-jpa-entity-graph version | Documentation ---------------------------- | --------------- | ----------------- 1.12.x | Not released yet | [1.12.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/master/doc/MAIN.md) 1.11.x | 1.11.01 | [1.11.x documentation](doc/MAIN.md) From 6b47b0342634878bd33c1e266a9481edc73e861d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Sat, 18 Mar 2017 14:06:08 +0100 Subject: [PATCH 16/27] Correct typo (cherry picked from commit 4005715) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 110e4e1..a26a11a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # Spring Data JPA EntityGraph -Today, [Spring Data JPA](https://github.com/spring-projects/spring-data-jpa) supports EntityGraph exlusively through annotations. +Today, [Spring Data JPA](https://github.com/spring-projects/spring-data-jpa) supports EntityGraph exclusively through annotations. Thus, for a method, the choice of EntityGraph must be made before compilation. This extension gives the ability to pass EntityGraph on any Spring Data JPA repository method as an argument, making the EntityGraph choice fully dynamic. From 64888942379055c4d65c63df42c44df8d82da21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Wed, 22 Mar 2017 12:31:20 +0100 Subject: [PATCH 17/27] Add genesis section (cherry picked from commit 9d4b6b6) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a26a11a..d6ed257 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,6 @@ spring-data-jpa branches | Latest spring-data-jpa-entity-graph version | Documen Example: if you were using `spring-data-jpa 1.10.13` in your project, you would need to select any `spring-data-jpa-entity-graph 1.10.x`. Thus `spring-data-jpa-entity-graph 1.10.14` would be eligible. +## Genesis + +This project was created following the discussion in Spring Data Tracker issue [DATAJPA-749](https://jira.spring.io/browse/DATAJPA-749) . \ No newline at end of file From bd343da16a82ac5f968e8e73e43e1a43304d673b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Wed, 22 Mar 2017 12:32:22 +0100 Subject: [PATCH 18/27] Add genesis section (cherry picked from commit 91fca38) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d6ed257..36a12b6 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,4 @@ Example: if you were using `spring-data-jpa 1.10.13` in your project, you would ## Genesis -This project was created following the discussion in Spring Data Tracker issue [DATAJPA-749](https://jira.spring.io/browse/DATAJPA-749) . \ No newline at end of file +This project was created following the discussion in Spring Data Tracker issue [DATAJPA-749 - Context enabled JPA 2.1 @EntityGraph](https://jira.spring.io/browse/DATAJPA-749) . \ No newline at end of file From 2c1b72e698ba5d50a880b1b7ddf9df02b6eae70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Thu, 23 Mar 2017 15:19:49 +0100 Subject: [PATCH 19/27] Fix #9 NoClassDefFoundError: com/mysema/commons/lang/Assert (cherry picked from commit 68d6178) --- .../spring/data/jpa/entity/graph/domain/EntityGraphUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/domain/EntityGraphUtils.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/domain/EntityGraphUtils.java index db46eda..f2f3fd6 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/domain/EntityGraphUtils.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/domain/EntityGraphUtils.java @@ -3,7 +3,7 @@ import java.util.Arrays; import java.util.List; -import com.mysema.commons.lang.Assert; +import org.springframework.util.Assert; /** * Created on 22/11/16. From c9a2d39b2268b10dbfc54483fd4b4f0e93774c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Thu, 23 Mar 2017 15:21:53 +0100 Subject: [PATCH 20/27] [maven-release-plugin] prepare release spring-data-jpa-entity-graph-1.11.02 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2189dde..f26663d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.02-SNAPSHOT + 1.11.02 1.6 @@ -236,7 +236,7 @@ scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph https://github.com/Cosium/spring-data-jpa-entity-graph - HEAD + spring-data-jpa-entity-graph-1.11.02 From c67e07b181fe4ca05ecc1c7b26aec3101382423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Thu, 23 Mar 2017 15:21:53 +0100 Subject: [PATCH 21/27] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f26663d..26a22e7 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.02 + 1.11.03-SNAPSHOT 1.6 @@ -236,7 +236,7 @@ scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph https://github.com/Cosium/spring-data-jpa-entity-graph - spring-data-jpa-entity-graph-1.11.02 + HEAD From d419d880cf5f6a8b35f6a4c0172fd63dfdd4c495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Thu, 23 Mar 2017 16:15:52 +0100 Subject: [PATCH 22/27] Bump to new releases --- README.md | 4 ++-- doc/MAIN.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 36a12b6..cebb514 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ This library follows the Spring Data JPA versionning semantic. spring-data-jpa branches | Latest spring-data-jpa-entity-graph version | Documentation ---------------------------- | --------------- | ----------------- 1.12.x | Not released yet | [1.12.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/master/doc/MAIN.md) -1.11.x | 1.11.01 | [1.11.x documentation](doc/MAIN.md) -1.10.x | 1.10.14 | [1.10.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/1.10.x/doc/MAIN.md) +1.11.x | 1.11.02 | [1.11.x documentation](doc/MAIN.md) +1.10.x | 1.10.15 | [1.10.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/1.10.x/doc/MAIN.md) Example: if you were using `spring-data-jpa 1.10.13` in your project, you would need to select any `spring-data-jpa-entity-graph 1.10.x`. Thus `spring-data-jpa-entity-graph 1.10.14` would be eligible. diff --git a/doc/MAIN.md b/doc/MAIN.md index edc14cc..d3fe839 100644 --- a/doc/MAIN.md +++ b/doc/MAIN.md @@ -5,7 +5,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.01 + 1.11.02 ``` 2. In your Spring configuration, set the repository factory bean class to `EntityGraphJpaRepositoryFactoryBean` : From e816f30a6ff265c1bfae03ecb749eb25da5f7f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Fri, 4 Aug 2017 11:39:23 +0200 Subject: [PATCH 23/27] Fix #11 How to customize repository base class --- .../repository/support/EntityGraphJpaRepositoryFactory.java | 2 +- .../repository/support/EntityGraphSimpleJpaRepository.java | 2 +- .../graph/repository/support/QueryDslEntityGraphRepository.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactory.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactory.java index 11727ad..b1fbc56 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactory.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphJpaRepositoryFactory.java @@ -22,7 +22,7 @@ * * @author Reda.Housni-Alaoui */ -class EntityGraphJpaRepositoryFactory extends JpaRepositoryFactory { +public class EntityGraphJpaRepositoryFactory extends JpaRepositoryFactory { static { addEntityGraphToSpecialTypes(); diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphSimpleJpaRepository.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphSimpleJpaRepository.java index 24b1ff3..1492973 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphSimpleJpaRepository.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/EntityGraphSimpleJpaRepository.java @@ -22,7 +22,7 @@ * * @author Reda.Housni-Alaoui */ -class EntityGraphSimpleJpaRepository +public class EntityGraphSimpleJpaRepository extends SimpleJpaRepository implements EntityGraphJpaRepository, EntityGraphJpaSpecificationExecutor { diff --git a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslEntityGraphRepository.java b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslEntityGraphRepository.java index fe605f0..addf589 100644 --- a/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslEntityGraphRepository.java +++ b/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryDslEntityGraphRepository.java @@ -21,7 +21,7 @@ * * @author Reda.Housni-Alaoui */ -class QueryDslEntityGraphRepository +public class QueryDslEntityGraphRepository extends EntityGraphSimpleJpaRepository implements EntityGraphQueryDslPredicateExecutor { private QueryDslJpaRepository queryDslJpaRepositoryDelegate; From a0849b7039fd9c73d279218dc4200d82d0cac1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Fri, 4 Aug 2017 11:40:10 +0200 Subject: [PATCH 24/27] [maven-release-plugin] prepare release spring-data-jpa-entity-graph-1.11.03 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 26a22e7..81f1611 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.03-SNAPSHOT + 1.11.03 1.6 @@ -236,7 +236,7 @@ scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph https://github.com/Cosium/spring-data-jpa-entity-graph - HEAD + spring-data-jpa-entity-graph-1.11.03 From 536f5fd5fe568a6b9456c02e452520616cae5f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Fri, 4 Aug 2017 11:40:10 +0200 Subject: [PATCH 25/27] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 81f1611..da35de3 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.03 + 1.11.04-SNAPSHOT 1.6 @@ -236,7 +236,7 @@ scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph scm:git:https://github.com/Cosium/spring-data-jpa-entity-graph https://github.com/Cosium/spring-data-jpa-entity-graph - spring-data-jpa-entity-graph-1.11.03 + HEAD From c31e4ceebc184eb58d38e89e795359ec44d6d5d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Fri, 4 Aug 2017 11:41:48 +0200 Subject: [PATCH 26/27] Bump to new releases --- README.md | 2 +- doc/MAIN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cebb514..df00223 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This library follows the Spring Data JPA versionning semantic. spring-data-jpa branches | Latest spring-data-jpa-entity-graph version | Documentation ---------------------------- | --------------- | ----------------- 1.12.x | Not released yet | [1.12.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/master/doc/MAIN.md) -1.11.x | 1.11.02 | [1.11.x documentation](doc/MAIN.md) +1.11.x | 1.11.03 | [1.11.x documentation](doc/MAIN.md) 1.10.x | 1.10.15 | [1.10.x documentation](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/1.10.x/doc/MAIN.md) Example: if you were using `spring-data-jpa 1.10.13` in your project, you would need to select any `spring-data-jpa-entity-graph 1.10.x`. Thus `spring-data-jpa-entity-graph 1.10.14` would be eligible. diff --git a/doc/MAIN.md b/doc/MAIN.md index d3fe839..7d58875 100644 --- a/doc/MAIN.md +++ b/doc/MAIN.md @@ -5,7 +5,7 @@ com.cosium.spring.data spring-data-jpa-entity-graph - 1.11.02 + 1.11.03 ``` 2. In your Spring configuration, set the repository factory bean class to `EntityGraphJpaRepositoryFactoryBean` : From 1a868f26294c996f5fe9d6cd9c8139d31d4acad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Thu, 30 Apr 2020 09:19:14 +0200 Subject: [PATCH 27/27] Use maven central through https --- src/site/resources/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/resources/settings.xml b/src/site/resources/settings.xml index 3756550..335188c 100644 --- a/src/site/resources/settings.xml +++ b/src/site/resources/settings.xml @@ -10,7 +10,7 @@ central central - http://repo1.maven.org/maven2 + https://repo1.maven.org/maven2 spring-snapshot-local