diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 37b9c09835..fd1e272769 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -70,10 +70,15 @@ jobs:
jdk: 8
spring-data: spring-data-2.4.x
deltaspike: deltaspike-1.9
+ - rdbms: h2
+ provider: hibernate-5.2
+ jdk: 8
+ spring-data: spring-data-2.5.x
+ deltaspike: deltaspike-1.9
- rdbms: postgresql
provider: hibernate-apt
jdk: 8
- spring-data: spring-data-2.5.x
+ spring-data: spring-data-2.6.x
deltaspike: deltaspike-1.9
################################################
@@ -479,37 +484,37 @@ jobs:
provider: hibernate-5.6
jdk: 17
deltaspike: deltaspike-1.9
- spring-data: spring-data-2.6.x
+ spring-data: spring-data-2.7.x
- rdbms: h2
provider: hibernate-5.6
jdk: 17
build-jdk: 17
deltaspike: deltaspike-1.9
- spring-data: spring-data-2.6.x
+ spring-data: spring-data-2.7.x
# Latest GA JDK
- rdbms: h2
provider: hibernate-5.6
jdk: 18
deltaspike: deltaspike-1.9
- spring-data: spring-data-2.6.x
+ spring-data: spring-data-2.7.x
- rdbms: h2
provider: hibernate-5.6
jdk: 18
build-jdk: 18
deltaspike: deltaspike-1.9
- spring-data: spring-data-2.6.x
+ spring-data: spring-data-2.7.x
# Early access JDKs
- rdbms: h2
provider: hibernate-5.6
jdk: 19-ea
deltaspike: deltaspike-1.9
- spring-data: spring-data-2.6.x
+ spring-data: spring-data-2.7.x
- rdbms: h2
provider: hibernate-5.6
jdk: 19-ea
build-jdk: 19-ea
deltaspike: deltaspike-1.9
- spring-data: spring-data-2.6.x
+ spring-data: spring-data-2.7.x
steps:
- uses: actions/checkout@v2
- name: Update /etc/hosts file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b621a67222..2dfec6f5ad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ Not yet released
* Add integration for Hibernate 6 supporting versions starting with 6.1.1.Final
* Support for Java 16, 17, 18 and 19 EA
* Support CTE's for left-nested set queries
+* Add separate integration modules for Spring Data 2.5, 2.6 and 2.7
### Bug fixes
diff --git a/checkstyle-rules/src/main/resources/blaze-persistence/checkstyle-suppressions.xml b/checkstyle-rules/src/main/resources/blaze-persistence/checkstyle-suppressions.xml
index e89a420375..467370b7d0 100644
--- a/checkstyle-rules/src/main/resources/blaze-persistence/checkstyle-suppressions.xml
+++ b/checkstyle-rules/src/main/resources/blaze-persistence/checkstyle-suppressions.xml
@@ -31,6 +31,8 @@
+
+
diff --git a/dist/bom/pom.xml b/dist/bom/pom.xml
index 389d3968c6..00b2d30fdf 100644
--- a/dist/bom/pom.xml
+++ b/dist/bom/pom.xml
@@ -330,6 +330,24 @@
${project.version}
compile
+
+ com.blazebit
+ blaze-persistence-integration-spring-data-2.5
+ ${project.version}
+ compile
+
+
+ com.blazebit
+ blaze-persistence-integration-spring-data-2.6
+ ${project.version}
+ compile
+
+
+ com.blazebit
+ blaze-persistence-integration-spring-data-2.7
+ ${project.version}
+ compile
+
com.blazebit
blaze-persistence-integration-spring-data-webmvc
diff --git a/dist/full/pom.xml b/dist/full/pom.xml
index 27a1bf7bc1..d15821ff68 100644
--- a/dist/full/pom.xml
+++ b/dist/full/pom.xml
@@ -183,6 +183,18 @@
com.blazebit
blaze-persistence-integration-spring-data-2.4
+
+ com.blazebit
+ blaze-persistence-integration-spring-data-2.5
+
+
+ com.blazebit
+ blaze-persistence-integration-spring-data-2.6
+
+
+ com.blazebit
+ blaze-persistence-integration-spring-data-2.7
+
com.blazebit
blaze-persistence-integration-spring-data-webmvc
diff --git a/documentation/src/main/asciidoc/entity-view/manual/en_US/getting_started.adoc b/documentation/src/main/asciidoc/entity-view/manual/en_US/getting_started.adoc
index 8dabb648db..7a004a68d7 100644
--- a/documentation/src/main/asciidoc/entity-view/manual/en_US/getting_started.adoc
+++ b/documentation/src/main/asciidoc/entity-view/manual/en_US/getting_started.adoc
@@ -142,13 +142,13 @@ When you work with Spring Data you can additionally have first class integration
----
com.blazebit
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.7
${blaze-persistence.version}
compile
----
-For Spring-Data version 2.3, 2.2, 2.1, 2.0 or 1.x use the artifact with the respective suffix `2.3`, `2.2`, `2.1`, `2.0`, `1.x`.
+For Spring-Data version 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0 or 1.x use the artifact with the respective suffix `2.6`, `2.5`, `2.4`, `2.3`, `2.2`, `2.1`, `2.0`, `1.x`.
NOTE: The Spring Data integration depends on the _jpa-criteria_ module
diff --git a/documentation/src/main/asciidoc/entity-view/manual/en_US/spring_data.adoc b/documentation/src/main/asciidoc/entity-view/manual/en_US/spring_data.adoc
index 96faed2f2c..3b12f33480 100644
--- a/documentation/src/main/asciidoc/entity-view/manual/en_US/spring_data.adoc
+++ b/documentation/src/main/asciidoc/entity-view/manual/en_US/spring_data.adoc
@@ -16,7 +16,7 @@ In short, the following Maven dependencies are required
----
com.blazebit
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.7
${blaze-persistence.version}
compile
@@ -28,7 +28,7 @@ In short, the following Maven dependencies are required
----
-For Spring-Data version 2.4, 2.3, 2.2, 2.1, 2.0 or 1.x use the `blaze-persistence-integration-spring-data` artifact with the respective suffix `2.4`, `2.3`, `2.2`, `2.1`, `2.0`, `1.x`.
+For Spring-Data version 2.6, 2.5, 2.4, 2.3, 2.2, 2.1, 2.0 or 1.x use the `blaze-persistence-integration-spring-data` artifact with the respective suffix `2.6`, `2.5` `2.4`, `2.3`, `2.2`, `2.1`, `2.0`, `1.x`.
The dependencies for other JPA providers or other versions can be found in the link:{core_doc}#maven-setup[core module setup section].
diff --git a/examples/showcase/base/pom.xml b/examples/showcase/base/pom.xml
index 578b8d885c..edea9989f4 100644
--- a/examples/showcase/base/pom.xml
+++ b/examples/showcase/base/pom.xml
@@ -32,9 +32,8 @@
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
diff --git a/examples/showcase/runner/spring/pom.xml b/examples/showcase/runner/spring/pom.xml
index c80e5e4bc8..56f963bb66 100644
--- a/examples/showcase/runner/spring/pom.xml
+++ b/examples/showcase/runner/spring/pom.xml
@@ -404,7 +404,7 @@
com.blazebit
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.5
@@ -422,7 +422,25 @@
com.blazebit
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.6
+
+
+
+
+ spring-data-2.7.x
+
+ ${version.spring-data-2.7-spring}
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.7}
+ provided
+
+
+ com.blazebit
+ blaze-persistence-integration-spring-data-2.7
diff --git a/examples/spring-data-dgs/pom.xml b/examples/spring-data-dgs/pom.xml
index d27aded659..12f9a868ce 100644
--- a/examples/spring-data-dgs/pom.xml
+++ b/examples/spring-data-dgs/pom.xml
@@ -459,7 +459,7 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.5
${project.groupId}
@@ -497,7 +497,45 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.6
+
+
+ ${project.groupId}
+ blaze-persistence-integration-hibernate-5.4
+
+
+
+
+ spring-data-2.7.x
+
+ ${version.spring-data-2.7-spring}
+ ${version.spring-data-2.7-spring-boot}
+ ${version.hibernate-5.4}
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.7}
+
+
+ org.aspectj
+ aspectjweaver
+ 1.9.4
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ 2.10.1
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ 2.10.1
+
+
+ ${project.groupId}
+ blaze-persistence-integration-spring-data-2.7
${project.groupId}
diff --git a/examples/spring-data-graphql/pom.xml b/examples/spring-data-graphql/pom.xml
index f31990d77c..5e716ca21b 100644
--- a/examples/spring-data-graphql/pom.xml
+++ b/examples/spring-data-graphql/pom.xml
@@ -426,7 +426,7 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.5
${project.groupId}
@@ -459,7 +459,40 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.6
+
+
+ ${project.groupId}
+ blaze-persistence-integration-hibernate-5.6
+
+
+
+
+ spring-data-2.7.x
+
+ ${version.spring-data-2.7-spring}
+ ${version.spring-data-2.7-spring-boot}
+ ${version.hibernate-5.6}
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.7}
+
+
+ org.aspectj
+ aspectjweaver
+ 1.9.4
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ 2.12.1
+
+
+ ${project.groupId}
+ blaze-persistence-integration-spring-data-2.7
${project.groupId}
diff --git a/examples/spring-data-spqr/pom.xml b/examples/spring-data-spqr/pom.xml
index 1c8f0bf5be..f8465d82c9 100644
--- a/examples/spring-data-spqr/pom.xml
+++ b/examples/spring-data-spqr/pom.xml
@@ -409,7 +409,7 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.5
${project.groupId}
@@ -442,7 +442,40 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.6
+
+
+ ${project.groupId}
+ blaze-persistence-integration-hibernate-5.6
+
+
+
+
+ spring-data-2.7.x
+
+ ${version.spring-data-2.7-spring}
+ ${version.spring-data-2.7-spring-boot}
+ ${version.hibernate-5.6}
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.7}
+
+
+ org.aspectj
+ aspectjweaver
+ 1.9.4
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ 2.12.1
+
+
+ ${project.groupId}
+ blaze-persistence-integration-spring-data-2.7
${project.groupId}
diff --git a/examples/spring-data-webflux/pom.xml b/examples/spring-data-webflux/pom.xml
index a1bc119e35..813e3331de 100644
--- a/examples/spring-data-webflux/pom.xml
+++ b/examples/spring-data-webflux/pom.xml
@@ -324,7 +324,7 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.5
${project.groupId}
@@ -352,7 +352,35 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.6
+
+
+ ${project.groupId}
+ blaze-persistence-integration-hibernate-5.6
+
+
+
+
+ spring-data-2.7.x
+
+ ${version.spring-data-2.7-spring}
+ ${version.spring-data-2.7-spring-boot}
+ ${version.hibernate-5.6}
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.7}
+
+
+ org.aspectj
+ aspectjweaver
+ 1.9.4
+
+
+ ${project.groupId}
+ blaze-persistence-integration-spring-data-2.7
${project.groupId}
diff --git a/examples/spring-data-webmvc/pom.xml b/examples/spring-data-webmvc/pom.xml
index 12250cf920..d3ecd2303a 100644
--- a/examples/spring-data-webmvc/pom.xml
+++ b/examples/spring-data-webmvc/pom.xml
@@ -362,7 +362,7 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.5
${project.groupId}
@@ -390,7 +390,35 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.6
+
+
+ ${project.groupId}
+ blaze-persistence-integration-hibernate-5.6
+
+
+
+
+ spring-data-2.7.x
+
+ ${version.spring-data-2.7-spring}
+ ${version.spring-data-2.7-spring-boot}
+ ${version.hibernate-5.6}
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.7}
+
+
+ org.aspectj
+ aspectjweaver
+ 1.9.4
+
+
+ ${project.groupId}
+ blaze-persistence-integration-spring-data-2.7
${project.groupId}
diff --git a/examples/spring-hateoas/pom.xml b/examples/spring-hateoas/pom.xml
index 3bb390d82d..6ee3298f4d 100644
--- a/examples/spring-hateoas/pom.xml
+++ b/examples/spring-hateoas/pom.xml
@@ -362,7 +362,7 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.5
${project.groupId}
@@ -390,7 +390,35 @@
${project.groupId}
- blaze-persistence-integration-spring-data-2.4
+ blaze-persistence-integration-spring-data-2.6
+
+
+ ${project.groupId}
+ blaze-persistence-integration-hibernate-5.6
+
+
+
+
+ spring-data-2.7.x
+
+ ${version.spring-data-2.7-spring}
+ ${version.spring-data-2.7-spring-boot}
+ ${version.hibernate-5.6}
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.7}
+
+
+ org.aspectj
+ aspectjweaver
+ 1.9.4
+
+
+ ${project.groupId}
+ blaze-persistence-integration-spring-data-2.7
${project.groupId}
diff --git a/integration/entity-view-cdi/pom.xml b/integration/entity-view-cdi/pom.xml
index a6ed8cad7e..512865e3a7 100644
--- a/integration/entity-view-cdi/pom.xml
+++ b/integration/entity-view-cdi/pom.xml
@@ -45,9 +45,8 @@
- org.hibernate.javax.persistence
- hibernate-jpa-2.0-api
- 1.0.1.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/entity-view-spring/pom.xml b/integration/entity-view-spring/pom.xml
index ee614c9c3f..ae12c9a57d 100644
--- a/integration/entity-view-spring/pom.xml
+++ b/integration/entity-view-spring/pom.xml
@@ -57,9 +57,8 @@
provided
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
@@ -260,5 +259,21 @@
+
+ spring-data-2.7.x
+
+ ${version.spring-data-2.7-spring}
+ 1.8
+ 1.8
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.7}
+ provided
+
+
+
\ No newline at end of file
diff --git a/integration/jaxrs-jackson/pom.xml b/integration/jaxrs-jackson/pom.xml
index cb94bc6452..13fa19ca2d 100644
--- a/integration/jaxrs-jackson/pom.xml
+++ b/integration/jaxrs-jackson/pom.xml
@@ -77,9 +77,8 @@
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/jaxrs-jsonb/pom.xml b/integration/jaxrs-jsonb/pom.xml
index 21c12809d8..e0ffa61566 100644
--- a/integration/jaxrs-jsonb/pom.xml
+++ b/integration/jaxrs-jsonb/pom.xml
@@ -82,9 +82,8 @@
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/spring-data/1.x/pom.xml b/integration/spring-data/1.x/pom.xml
index 8841b6a043..5ff2e577a0 100644
--- a/integration/spring-data/1.x/pom.xml
+++ b/integration/spring-data/1.x/pom.xml
@@ -51,9 +51,8 @@
blaze-persistence-jpa-criteria-impl
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/spring-data/1.x/src/main/java/com/blazebit/persistence/spring/data/impl/repository/BlazePersistenceRepositoryFactoryBean.java b/integration/spring-data/1.x/src/main/java/com/blazebit/persistence/spring/data/impl/repository/BlazePersistenceRepositoryFactoryBean.java
index b74bb301a1..2faa12d302 100644
--- a/integration/spring-data/1.x/src/main/java/com/blazebit/persistence/spring/data/impl/repository/BlazePersistenceRepositoryFactoryBean.java
+++ b/integration/spring-data/1.x/src/main/java/com/blazebit/persistence/spring/data/impl/repository/BlazePersistenceRepositoryFactoryBean.java
@@ -118,4 +118,11 @@ public void afterPropertiesSet() {
super.afterPropertiesSet();
}
+ public void setEscapeCharacter(char escapeCharacter) {
+ }
+
+ public char getEscapeCharacter() {
+ return '\\';
+ }
+
}
diff --git a/integration/spring-data/1.x/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java b/integration/spring-data/1.x/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
index df7d6b617a..337b904a3c 100644
--- a/integration/spring-data/1.x/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
+++ b/integration/spring-data/1.x/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
@@ -54,7 +54,7 @@ protected Map tryGetFetchGraphHints(EntityManager entityManager,
public S findOne(Example example) {
try {
- return getQuery(new ExampleSpecification<>(example), example.getProbeType(), (Sort) null).getSingleResult();
+ return getQuery(new ExampleSpecification<>(example, escapeCharacter), example.getProbeType(), (Sort) null).getSingleResult();
} catch (NoResultException e) {
return null;
}
diff --git a/integration/spring-data/2.0/pom.xml b/integration/spring-data/2.0/pom.xml
index 092d2827bc..a16f60533f 100644
--- a/integration/spring-data/2.0/pom.xml
+++ b/integration/spring-data/2.0/pom.xml
@@ -85,9 +85,8 @@
blaze-persistence-jpa-criteria-impl
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/spring-data/2.0/src/main/java/com/blazebit/persistence/spring/data/impl/repository/BlazePersistenceRepositoryFactoryBean.java b/integration/spring-data/2.0/src/main/java/com/blazebit/persistence/spring/data/impl/repository/BlazePersistenceRepositoryFactoryBean.java
index b74bb301a1..2faa12d302 100644
--- a/integration/spring-data/2.0/src/main/java/com/blazebit/persistence/spring/data/impl/repository/BlazePersistenceRepositoryFactoryBean.java
+++ b/integration/spring-data/2.0/src/main/java/com/blazebit/persistence/spring/data/impl/repository/BlazePersistenceRepositoryFactoryBean.java
@@ -118,4 +118,11 @@ public void afterPropertiesSet() {
super.afterPropertiesSet();
}
+ public void setEscapeCharacter(char escapeCharacter) {
+ }
+
+ public char getEscapeCharacter() {
+ return '\\';
+ }
+
}
diff --git a/integration/spring-data/2.0/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java b/integration/spring-data/2.0/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
index b6abd547eb..3b3da740ee 100644
--- a/integration/spring-data/2.0/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
+++ b/integration/spring-data/2.0/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
@@ -56,7 +56,7 @@ protected Map tryGetFetchGraphHints(EntityManager entityManager,
@WithBridgeMethods(value = Object.class, adapterMethod = "convert")
public Optional findOne(Example example) {
try {
- return Optional.of(getQuery(new ExampleSpecification<>(example), example.getProbeType(), (Sort) null).getSingleResult());
+ return Optional.of(getQuery(new ExampleSpecification<>(example, escapeCharacter), example.getProbeType(), (Sort) null).getSingleResult());
} catch (NoResultException e) {
return Optional.empty();
}
diff --git a/integration/spring-data/2.1/pom.xml b/integration/spring-data/2.1/pom.xml
index 750fa9386e..0ce68ebc06 100644
--- a/integration/spring-data/2.1/pom.xml
+++ b/integration/spring-data/2.1/pom.xml
@@ -86,9 +86,8 @@
blaze-persistence-jpa-criteria-impl
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/spring-data/2.1/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java b/integration/spring-data/2.1/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
index 2718e86781..9804bbd86f 100644
--- a/integration/spring-data/2.1/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
+++ b/integration/spring-data/2.1/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
@@ -54,7 +54,7 @@ public EntityViewAwareRepositoryImpl(JpaEntityInformation entityInformatio
@WithBridgeMethods(value = Object.class, adapterMethod = "convert")
public Optional findOne(Example example) {
try {
- return Optional.of(getQuery(new ExampleSpecification<>(example), example.getProbeType(), (Sort) null).getSingleResult());
+ return Optional.of(getQuery(new ExampleSpecification<>(example, escapeCharacter), example.getProbeType(), (Sort) null).getSingleResult());
} catch (NoResultException e) {
return Optional.empty();
}
diff --git a/integration/spring-data/2.2/pom.xml b/integration/spring-data/2.2/pom.xml
index 00ca857f73..2d6cb0a6cc 100644
--- a/integration/spring-data/2.2/pom.xml
+++ b/integration/spring-data/2.2/pom.xml
@@ -86,9 +86,8 @@
blaze-persistence-jpa-criteria-impl
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/spring-data/2.2/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java b/integration/spring-data/2.2/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
index c37f19de13..1c5ea835b7 100644
--- a/integration/spring-data/2.2/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
+++ b/integration/spring-data/2.2/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
@@ -59,7 +59,7 @@ protected Map tryGetFetchGraphHints(EntityManager entityManager,
@WithBridgeMethods(value = Object.class, adapterMethod = "convert")
public Optional findOne(Example example) {
try {
- return Optional.of(getQuery(new ExampleSpecification<>(example), example.getProbeType(), (Sort) null).getSingleResult());
+ return Optional.of(getQuery(new ExampleSpecification<>(example, escapeCharacter), example.getProbeType(), (Sort) null).getSingleResult());
} catch (NoResultException e) {
return Optional.empty();
}
diff --git a/integration/spring-data/2.3/pom.xml b/integration/spring-data/2.3/pom.xml
index 684f0393aa..1731ff41c5 100644
--- a/integration/spring-data/2.3/pom.xml
+++ b/integration/spring-data/2.3/pom.xml
@@ -107,9 +107,8 @@
blaze-persistence-jpa-criteria-impl
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/spring-data/2.3/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java b/integration/spring-data/2.3/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
index c37f19de13..1c5ea835b7 100644
--- a/integration/spring-data/2.3/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
+++ b/integration/spring-data/2.3/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
@@ -59,7 +59,7 @@ protected Map tryGetFetchGraphHints(EntityManager entityManager,
@WithBridgeMethods(value = Object.class, adapterMethod = "convert")
public Optional findOne(Example example) {
try {
- return Optional.of(getQuery(new ExampleSpecification<>(example), example.getProbeType(), (Sort) null).getSingleResult());
+ return Optional.of(getQuery(new ExampleSpecification<>(example, escapeCharacter), example.getProbeType(), (Sort) null).getSingleResult());
} catch (NoResultException e) {
return Optional.empty();
}
diff --git a/integration/spring-data/2.4/pom.xml b/integration/spring-data/2.4/pom.xml
index 2763ba7f7f..7bc8dfb374 100644
--- a/integration/spring-data/2.4/pom.xml
+++ b/integration/spring-data/2.4/pom.xml
@@ -107,9 +107,8 @@
blaze-persistence-jpa-criteria-impl
- org.hibernate.javax.persistence
- hibernate-jpa-2.1-api
- 1.0.0.Final
+ jakarta.persistence
+ jakarta.persistence-api
provided
diff --git a/integration/spring-data/2.4/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java b/integration/spring-data/2.4/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
index da3b83c327..e8e0a98efe 100644
--- a/integration/spring-data/2.4/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
+++ b/integration/spring-data/2.4/src/main/java/com/blazebit/persistence/spring/data/impl/repository/EntityViewAwareRepositoryImpl.java
@@ -62,7 +62,7 @@ protected Map tryGetFetchGraphHints(EntityManager entityManager,
@WithBridgeMethods(value = Object.class, adapterMethod = "convert")
public Optional findOne(Example example) {
try {
- return Optional.of(getQuery(new ExampleSpecification<>(example), example.getProbeType(), (Sort) null).getSingleResult());
+ return Optional.of(getQuery(new ExampleSpecification<>(example, escapeCharacter), example.getProbeType(), (Sort) null).getSingleResult());
} catch (NoResultException e) {
return Optional.empty();
}
diff --git a/integration/spring-data/2.5/pom.xml b/integration/spring-data/2.5/pom.xml
new file mode 100644
index 0000000000..1c90f0159a
--- /dev/null
+++ b/integration/spring-data/2.5/pom.xml
@@ -0,0 +1,263 @@
+
+
+
+ blaze-persistence-integration-spring-data-parent
+ com.blazebit
+ 1.6.7-SNAPSHOT
+ ../pom.xml
+
+ 4.0.0
+
+ Blazebit Persistence Integration Spring-Data 2.5
+ blaze-persistence-integration-spring-data-2.5
+
+
+ com.blazebit.persistence.integration.spring.data.impl
+
+
+ ${version.spring-data-2.5-spring}
+ 1.2.1
+ 1.3.6
+ 1.8
+ 1.8
+
+
+
+
+
+ org.springframework
+ spring-framework-bom
+ ${version.spring}
+ import
+ pom
+
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-bom
+ ${kotlin-coroutines}
+ pom
+ import
+
+
+
+
+
+
+ repo.jenkins-ci.org
+ https://repo.jenkins-ci.org/public/
+
+
+
+
+ repo.jenkins-ci.org
+ https://repo.jenkins-ci.org/public/
+
+
+
+
+
+ org.springframework.data
+ spring-data-jpa
+ ${version.spring-data-2.5}
+ provided
+
+
+
+ io.reactivex
+ rxjava-reactive-streams
+ ${rxjava-reactive-streams}
+ true
+
+
+ org.jetbrains.kotlinx
+ kotlinx-coroutines-reactive
+ true
+
+
+
+ com.infradna.tool
+ bridge-method-annotation
+ ${version.bridge-injector}
+ provided
+
+
+ org.jenkins-ci
+ annotation-indexer
+
+
+
+
+
+ org.jenkins-ci
+ annotation-indexer
+ ${version.bridge-injector-indexer}
+ provided
+
+
+
+ com.blazebit
+ blaze-persistence-entity-view-api
+
+
+ com.blazebit
+ blaze-persistence-jpa-criteria-api
+
+
+ com.blazebit
+ blaze-persistence-jpa-criteria-impl
+
+
+ jakarta.persistence
+ jakarta.persistence-api
+ provided
+
+
+
+
+ com.blazebit
+ blaze-persistence-integration-spring-data-base
+ compile
+
+
+ com.blazebit
+ blaze-persistence-integration-entity-view-spring
+ compile
+
+
+ com.blazebit
+ blaze-persistence-core-impl
+ runtime
+
+
+ com.blazebit
+ blaze-persistence-entity-view-impl
+ runtime
+
+
+
+
+
+ org.springframework
+ spring-test
+ test
+
+
+ junit
+ junit
+ test
+
+
+
+
+
+
+ org.moditect
+ moditect-maven-plugin
+
+
+ add-module-infos
+ package
+
+ add-module-info
+
+
+
+
+ module ${module.name} {
+ requires transitive com.blazebit.persistence.integration.spring.data;
+ exports com.blazebit.persistence.spring.data.impl.query;
+ exports com.blazebit.persistence.spring.data.impl.repository;
+ }
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ add-resource
+ generate-resources
+
+ add-resource
+
+
+
+
+ target/generated/resources
+
+
+
+
+
+
+
+ org.bsc.maven
+ maven-processor-plugin
+
+
+ process
+
+ process
+
+ generate-sources
+
+
+ target/generated/resources
+
+ org.jvnet.hudson.annotation_indexer.AnnotationProcessorImpl
+
+
+
+
+
+
+ com.infradna.tool
+ bridge-method-annotation
+ ${version.bridge-injector}
+
+
+
+ org.jenkins-ci
+ annotation-indexer
+ ${version.bridge-injector-indexer}
+
+
+
+
+ com.infradna.tool
+ bridge-method-injector
+ ${version.bridge-injector}
+
+
+
+ process
+
+
+
+
+
+
+ org.ow2.asm
+ asm-debug-all
+ CUSTOM
+
+
+ org.ow2.asm
+ asm
+ ${version.bridge-injector-asm}
+
+
+ org.ow2.asm
+ asm-commons
+ ${version.bridge-injector-asm}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/CriteriaQueryParameterBinder.java b/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/CriteriaQueryParameterBinder.java
new file mode 100644
index 0000000000..356792688f
--- /dev/null
+++ b/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/CriteriaQueryParameterBinder.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2014 - 2022 Blazebit.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.blazebit.persistence.spring.data.impl.query;
+
+import com.blazebit.persistence.spring.data.base.query.AbstractCriteriaQueryParameterBinder;
+import com.blazebit.persistence.spring.data.base.query.JpaParameters;
+import com.blazebit.persistence.spring.data.base.query.ParameterMetadataProvider;
+import com.blazebit.persistence.spring.data.repository.KeysetPageable;
+import com.blazebit.persistence.view.EntityViewManager;
+import org.springframework.data.domain.Pageable;
+
+import javax.persistence.EntityManager;
+
+/**
+ * Concrete version for Spring Data 2.x.
+ *
+ * @author Christian Beikov
+ * @since 1.3.0
+ */
+public class CriteriaQueryParameterBinder extends AbstractCriteriaQueryParameterBinder {
+
+ public CriteriaQueryParameterBinder(EntityManager em, EntityViewManager evm, JpaParameters parameters, Object[] values, Iterable> expressions) {
+ super(em, evm, parameters, values, expressions);
+ }
+
+ @Override
+ protected int getOffset() {
+ Pageable pageable = getPageable();
+ if (pageable instanceof KeysetPageable) {
+ return ((KeysetPageable) pageable).getIntOffset();
+ } else {
+ return (int) pageable.getOffset();
+ }
+ }
+}
diff --git a/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/EntityViewAwareRepositoryInformation.java b/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/EntityViewAwareRepositoryInformation.java
new file mode 100644
index 0000000000..295033fc58
--- /dev/null
+++ b/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/EntityViewAwareRepositoryInformation.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2014 - 2022 Blazebit.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.blazebit.persistence.spring.data.impl.query;
+
+import com.blazebit.persistence.spring.data.base.query.EntityViewAwareRepositoryMetadata;
+import com.blazebit.persistence.view.EntityViewManager;
+import org.springframework.data.repository.core.CrudMethods;
+import org.springframework.data.repository.core.RepositoryInformation;
+import org.springframework.data.util.Streamable;
+import org.springframework.data.util.TypeInformation;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+/**
+ * @author Christian Beikov
+ * @since 1.2.0
+ */
+public class EntityViewAwareRepositoryInformation implements RepositoryInformation, EntityViewAwareRepositoryMetadata {
+
+ private final EntityViewAwareRepositoryMetadata metadata;
+ private final RepositoryInformation repositoryInformation;
+
+ public EntityViewAwareRepositoryInformation(EntityViewAwareRepositoryMetadata metadata, RepositoryInformation repositoryInformation) {
+ this.metadata = metadata;
+ this.repositoryInformation = repositoryInformation;
+ }
+
+ @Override
+ public EntityViewManager getEntityViewManager() {
+ return metadata.getEntityViewManager();
+ }
+
+ @Override
+ public Class> getRepositoryBaseClass() {
+ return repositoryInformation.getRepositoryBaseClass();
+ }
+
+ @Override
+ public boolean hasCustomMethod() {
+ return repositoryInformation.hasCustomMethod();
+ }
+
+ @Override
+ public boolean isCustomMethod(Method method) {
+ return repositoryInformation.isCustomMethod(method);
+ }
+
+ @Override
+ public boolean isQueryMethod(Method method) {
+ return repositoryInformation.isQueryMethod(method);
+ }
+
+ @Override
+ public boolean isBaseClassMethod(Method method) {
+ return repositoryInformation.isBaseClassMethod(method);
+ }
+
+ @Override
+ public Streamable getQueryMethods() {
+ return repositoryInformation.getQueryMethods();
+ }
+
+ @Override
+ public Method getTargetClassMethod(Method method) {
+ return repositoryInformation.getTargetClassMethod(method);
+ }
+
+ @Override
+ public Class extends Serializable> getIdType() {
+ return (Class extends Serializable>) repositoryInformation.getIdType();
+ }
+
+ @Override
+ public Class> getDomainType() {
+ return repositoryInformation.getDomainType();
+ }
+
+ @Override
+ public Class> getEntityViewType() {
+ return metadata.getEntityViewType();
+ }
+
+ @Override
+ public Class> getRepositoryInterface() {
+ return repositoryInformation.getRepositoryInterface();
+ }
+
+ @Override
+ public Class> getReturnedDomainClass(Method method) {
+ return repositoryInformation.getReturnedDomainClass(method);
+ }
+
+ @Override
+ public Class> getReturnedEntityViewClass(Method method) {
+ return metadata.getReturnedEntityViewClass(method);
+ }
+
+ @Override
+ public CrudMethods getCrudMethods() {
+ return repositoryInformation.getCrudMethods();
+ }
+
+ @Override
+ public boolean isPagingRepository() {
+ return repositoryInformation.isPagingRepository();
+ }
+
+ @Override
+ public Set> getAlternativeDomainTypes() {
+ return repositoryInformation.getAlternativeDomainTypes();
+ }
+
+ public boolean isReactiveRepository() {
+ return metadata.isReactiveRepository();
+ }
+
+ @Override
+ public TypeInformation> getReturnType(Method method) {
+ return repositoryInformation.getReturnType(method);
+ }
+}
diff --git a/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/EntityViewAwareRepositoryMetadataImpl.java b/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/EntityViewAwareRepositoryMetadataImpl.java
new file mode 100644
index 0000000000..33fd066780
--- /dev/null
+++ b/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/EntityViewAwareRepositoryMetadataImpl.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2014 - 2022 Blazebit.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.blazebit.persistence.spring.data.impl.query;
+
+import com.blazebit.persistence.spring.data.base.query.EntityViewAwareRepositoryMetadata;
+import com.blazebit.persistence.view.EntityViewManager;
+import com.blazebit.persistence.view.metamodel.ManagedViewType;
+import org.springframework.data.repository.core.CrudMethods;
+import org.springframework.data.repository.core.RepositoryMetadata;
+import org.springframework.data.util.TypeInformation;
+
+import java.lang.reflect.Method;
+import java.util.Set;
+
+/**
+ * @author Christian Beikov
+ * @since 1.2.0
+ */
+public class EntityViewAwareRepositoryMetadataImpl implements EntityViewAwareRepositoryMetadata {
+
+ private final RepositoryMetadata metadata;
+ private final EntityViewManager evm;
+ private final Class> domainType;
+ private final Class> entityViewType;
+
+ public EntityViewAwareRepositoryMetadataImpl(RepositoryMetadata metadata, EntityViewManager evm) {
+ this.metadata = metadata;
+ this.evm = evm;
+ Class> domainType = metadata.getDomainType();
+ ManagedViewType> managedViewType = evm.getMetamodel().managedView(domainType);
+ if (managedViewType == null) {
+ this.domainType = domainType;
+ this.entityViewType = null;
+ } else {
+ this.domainType = managedViewType.getEntityClass();
+ this.entityViewType = managedViewType.getJavaType();
+ }
+ }
+
+ @Override
+ public EntityViewManager getEntityViewManager() {
+ return evm;
+ }
+
+ @Override
+ public Class> getIdType() {
+ return metadata.getIdType();
+ }
+
+ @Override
+ public Class> getDomainType() {
+ return domainType;
+ }
+
+ @Override
+ public Class> getEntityViewType() {
+ return entityViewType;
+ }
+
+ @Override
+ public Class> getRepositoryInterface() {
+ return metadata.getRepositoryInterface();
+ }
+
+ @Override
+ public Class> getReturnedDomainClass(Method method) {
+ Class> returnedDomainClass = metadata.getReturnedDomainClass(method);
+ ManagedViewType> managedViewType = evm.getMetamodel().managedView(returnedDomainClass);
+ if (managedViewType == null) {
+ return returnedDomainClass;
+ } else {
+ return managedViewType.getEntityClass();
+ }
+ }
+
+ @Override
+ public TypeInformation> getReturnType(Method method) {
+ return metadata.getReturnType(method);
+ }
+
+ @Override
+ public Class> getReturnedEntityViewClass(Method method) {
+ Class> returnedDomainClass = metadata.getReturnedDomainClass(method);
+ ManagedViewType> managedViewType = evm.getMetamodel().managedView(returnedDomainClass);
+ if (managedViewType == null) {
+ return null;
+ } else {
+ return managedViewType.getJavaType();
+ }
+ }
+
+ @Override
+ public CrudMethods getCrudMethods() {
+ return metadata.getCrudMethods();
+ }
+
+ @Override
+ public boolean isPagingRepository() {
+ return metadata.isPagingRepository();
+ }
+
+ @Override
+ public Set> getAlternativeDomainTypes() {
+ return metadata.getAlternativeDomainTypes();
+ }
+
+ @Override
+ public boolean isReactiveRepository() {
+ return metadata.isReactiveRepository();
+ }
+}
diff --git a/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/ParameterMetadataProviderImpl.java b/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/ParameterMetadataProviderImpl.java
new file mode 100644
index 0000000000..c6f59f065d
--- /dev/null
+++ b/integration/spring-data/2.5/src/main/java/com/blazebit/persistence/spring/data/impl/query/ParameterMetadataProviderImpl.java
@@ -0,0 +1,309 @@
+/*
+ * Copyright 2011-2019 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.blazebit.persistence.spring.data.impl.query;
+
+import com.blazebit.persistence.spring.data.base.query.ParameterMetadataProvider;
+import org.springframework.data.jpa.provider.PersistenceProvider;
+import org.springframework.data.jpa.repository.query.EscapeCharacter;
+import org.springframework.data.repository.query.Parameter;
+import org.springframework.data.repository.query.Parameters;
+import org.springframework.data.repository.query.ParametersParameterAccessor;
+import org.springframework.data.repository.query.parser.Part;
+import org.springframework.data.repository.query.parser.Part.IgnoreCaseType;
+import org.springframework.data.repository.query.parser.Part.Type;
+import org.springframework.expression.Expression;
+import org.springframework.util.Assert;
+import org.springframework.util.ClassUtils;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.ParameterExpression;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+
+/**
+ * Helper class to allow easy creation of {@link ParameterMetadata}s.
+ *
+ * Christian Beikov: Copied while implementing the shared interface to be able to share code between Spring Data integrations for 1.x and 2.x.
+ *
+ * @author Oliver Gierke
+ * @author Thomas Darimont
+ * @author Mark Paluch
+ * @author Christoph Strobl
+ * @author Jens Schauder
+ * @author Andrey Kovalev
+ */
+class ParameterMetadataProviderImpl implements ParameterMetadataProvider {
+
+ private final CriteriaBuilder builder;
+ private final Iterator extends Parameter> parameters;
+ private final List> expressions;
+ private final Iterator