Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: spring-projects/spring-data-commons
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: spring-projects/spring-data-commons
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.4.x
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Nov 15, 2024

  1. Prepare next development iteration.

    See #3183
    mp911de committed Nov 15, 2024
    Copy the full SHA
    65b5b50 View commit details
  2. After release cleanups.

    See #3183
    mp911de committed Nov 15, 2024
    Copy the full SHA
    02ffabc View commit details

Commits on Nov 18, 2024

  1. Polishing.

    Fix deprecation version.
    
    See #3183
    mp911de committed Nov 18, 2024
    Copy the full SHA
    0a2e9f1 View commit details

Commits on Nov 29, 2024

  1. Refine Value Expression documentation.

    Closes #3214
    mp911de committed Nov 29, 2024
    Copy the full SHA
    2f11039 View commit details

Commits on Dec 2, 2024

  1. Resolve bridged method when projected PropertyDescriptor resolves to …

    …a bridge method.
    
    We now skip synthetic bridge methods when resolving a PropertyDescriptor from a called interface method on the target type and resolve the bridged method.
    
    Closes #3215
    mp911de committed Dec 2, 2024
    Copy the full SHA
    4bdcbd0 View commit details
  2. Polishing.

    Fix ticket reference.
    
    See #3215
    mp911de committed Dec 2, 2024
    Copy the full SHA
    36b0c26 View commit details

Commits on Dec 3, 2024

  1. Copy the full SHA
    75175d6 View commit details

Commits on Dec 13, 2024

  1. Prepare 3.4.1 (2024.1.1).

    See #3204
    christophstrobl committed Dec 13, 2024
    Copy the full SHA
    91697f8 View commit details
  2. Copy the full SHA
    264dcdd View commit details
  3. Copy the full SHA
    380cd21 View commit details
  4. After release cleanups.

    See #3204
    christophstrobl committed Dec 13, 2024
    Copy the full SHA
    3c382f9 View commit details

Commits on Jan 8, 2025

  1. Copy the full SHA
    3f0f788 View commit details

Commits on Jan 10, 2025

  1. Refining QBE documentation.

    Adds a configurable limitation about collection support in Query By Example.
    
    Closes: #3226
    schauder authored and mp911de committed Jan 10, 2025
    Copy the full SHA
    ccf3e04 View commit details

Commits on Jan 13, 2025

  1. Fix typos.

    Documentation, assertion messages.
    
    Closes #3223
    ngocnhan-tran1996 authored and mp911de committed Jan 13, 2025
    Copy the full SHA
    19af483 View commit details

Commits on Jan 15, 2025

  1. Skip unnamed DTO projection properties.

    We now skip unnamed DTO projection properties and issue a warning log to raise awareness.
    
    Skipping unnamed (null) properties avoids identification as DTO and only selects properties stemming from named constructor arguments.
    
    Add tests for Kotlin data classes using value classes for verification.
    
    Closes #3225
    mp911de committed Jan 15, 2025
    Copy the full SHA
    b60feb7 View commit details

Commits on Jan 17, 2025

  1. Prepare 3.4.2 (2024.1.2).

    See #3221
    mp911de committed Jan 17, 2025
    Copy the full SHA
    dba527c View commit details
  2. Release version 3.4.2 (2024.1.2).

    See #3221
    mp911de committed Jan 17, 2025
    Copy the full SHA
    0345e9c View commit details
  3. Prepare next development iteration.

    See #3221
    mp911de committed Jan 17, 2025
    Copy the full SHA
    86d793b View commit details
  4. After release cleanups.

    See #3221
    mp911de committed Jan 17, 2025
    Copy the full SHA
    a9b9008 View commit details

Commits on Jan 21, 2025

  1. Copy the full SHA
    c2f2cb8 View commit details

Commits on Jan 22, 2025

  1. Document OpenFeign Querydsl support.

    Closes #3236
    mp911de committed Jan 22, 2025
    Copy the full SHA
    be0d8c3 View commit details
  2. Fix Querydsl Nullability annotations.

    Closes #2044
    mp911de committed Jan 22, 2025
    Copy the full SHA
    d197037 View commit details
  3. Copy the full SHA
    b8950af View commit details

Commits on Feb 11, 2025

  1. Update CI Properties.

    See #3234
    mp911de committed Feb 11, 2025
    Copy the full SHA
    191300a View commit details

Commits on Feb 13, 2025

  1. Copy the full SHA
    232a3da View commit details
  2. Polishing.

    Fix Querydsl lettercasing.
    
    See #3243
    mp911de committed Feb 13, 2025
    Copy the full SHA
    15f254b View commit details

Commits on Feb 14, 2025

  1. Prepare 3.4.3 (2024.1.3).

    See #3234
    mp911de committed Feb 14, 2025
    Copy the full SHA
    b2d5be1 View commit details
  2. Release version 3.4.3 (2024.1.3).

    See #3234
    mp911de committed Feb 14, 2025
    Copy the full SHA
    fe54d7a View commit details
  3. Prepare next development iteration.

    See #3234
    mp911de committed Feb 14, 2025
    Copy the full SHA
    4689477 View commit details
  4. After release cleanups.

    See #3234
    mp911de committed Feb 14, 2025
    Copy the full SHA
    7bab2c7 View commit details

Commits on Feb 20, 2025

  1. Consider getters using get as getter for boolean Kotlin properties.

    We now additionally consider get-prefixed methods in addition to is-prefixed methods as getters for boolean properties.
    
    Closes #3249
    mp911de committed Feb 20, 2025
    Copy the full SHA
    3c625ca View commit details

Commits on Mar 5, 2025

  1. Remove branching overhead in BytecodeUtil by replacing if with `e…

    …lse if`.
    
    Closes #3168
    mitu2 authored and mp911de committed Mar 5, 2025
    Copy the full SHA
    e79a2bd View commit details
  2. Polishing.

    Reformat code.
    
    See #3168
    mp911de committed Mar 5, 2025
    Copy the full SHA
    bb59eb4 View commit details

Commits on Mar 6, 2025

  1. Revise RepositoryInformation and RepositoryComposition caching.

    We now use a refined strategy to cache RepositoryInformation and RepositoryComposition.
    
    Previously, RepositoryComposition wasn't cached at all and store modules that e.g. contributed a Querydsl (or a different) fragment based on the interface declaration returned a new RepositoryComposition (and thus a different hashCode) each time RepositoryInformation was obtained leading to memory leaks caused by HashMap caching.
    
    We now use Fragment's hashCode for the cache key resulting in RepositoryComposition being created only once for a given repository interface and input-fragments arrangement.
    
    Closes #3252
    mp911de committed Mar 6, 2025
    Copy the full SHA
    50b74f6 View commit details

Commits on Mar 14, 2025

  1. Prepare 3.4.4 (2024.1.4).

    See #3246
    mp911de committed Mar 14, 2025
    Copy the full SHA
    29fb105 View commit details
  2. Release version 3.4.4 (2024.1.4).

    See #3246
    mp911de committed Mar 14, 2025
    Copy the full SHA
    aba2047 View commit details
  3. Prepare next development iteration.

    See #3246
    mp911de committed Mar 14, 2025
    Copy the full SHA
    2b020d5 View commit details
  4. After release cleanups.

    See #3246
    mp911de committed Mar 14, 2025
    Copy the full SHA
    a861600 View commit details
Showing 999 changed files with 1,987 additions and 1,690 deletions.
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
<extension>
<groupId>io.spring.develocity.conventions</groupId>
<artifactId>develocity-conventions-maven-extension</artifactId>
<version>0.0.19</version>
<version>0.0.22</version>
</extension>
</extensions>
10 changes: 10 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ pipeline {

triggers {
pollSCM 'H/10 * * * *'
upstream(upstreamProjects: "spring-data-build/main", threshold: hudson.model.Result.SUCCESS)
upstream(upstreamProjects: "spring-data-build/3.4.x", threshold: hudson.model.Result.SUCCESS)
}

options {
20 changes: 16 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>3.4.0</version>
<version>3.4.5-SNAPSHOT</version>

<name>Spring Data Core</name>
<description>Core Spring concepts underpinning every Spring Data module.</description>
@@ -25,7 +25,7 @@
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>3.4.0</version>
<version>3.4.5-SNAPSHOT</version>
</parent>

<properties>
@@ -380,8 +380,20 @@
</profiles>

<repositories>


<repository>
<id>spring-snapshot</id>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>spring-milestone</id>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>

</project>
2 changes: 1 addition & 1 deletion src/main/antora/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ Oliver Gierke; Thomas Darimont; Christoph Strobl; Mark Pollack; Thomas Risberg;
:revdate: {localdate}
:feature-scroll: true

(C) 2008-2024 The original authors.
(C) 2008-2025 The original authors.

NOTE: Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

4 changes: 2 additions & 2 deletions src/main/antora/modules/ROOT/pages/object-mapping.adoc
Original file line number Diff line number Diff line change
@@ -223,7 +223,7 @@ It's an established pattern to rather use static factory methods to expose these
[[mapping.general-recommendations.override.properties]]
=== Overriding Properties

Java's allows a flexible design of domain classes where a subclass could define a property that is already declared with the same name in its superclass.
Java allows a flexible design of domain classes where a subclass could define a property that is already declared with the same name in its superclass.
Consider the following example:

[source,java]
@@ -326,7 +326,7 @@ data class Person(var id: String, val name: String) {
----

Kotlin supports parameter optionality by allowing default values to be used if a parameter is not provided.
When Spring Data detects a constructor with parameter defaulting, then it leaves these parameters absent if the data store does not provide a value (or simply returns `null`) so Kotlin can apply parameter defaulting.Consider the following class that applies parameter defaulting for `name`
When Spring Data detects a constructor with parameter defaulting, then it leaves these parameters absent if the data store does not provide a value (or simply returns `null`) so Kotlin can apply parameter defaulting. Consider the following class that applies parameter defaulting for `name`

[source,kotlin]
----
7 changes: 7 additions & 0 deletions src/main/antora/modules/ROOT/pages/query-by-example.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
ifndef::support-qbe-collection[]
:support-qbe-collection: true
endif::[]

[[query-by-example]]
= Query by Example

@@ -36,6 +40,9 @@ Query by Example is well suited for several use cases:
Query by Example also has several limitations:

* No support for nested or grouped property constraints, such as `firstname = ?0 or (firstname = ?1 and lastname = ?2)`.
ifeval::[{support-qbe-collection} != true]
* No support for matching collections or maps.
endif::[]
* Store-specific support on string matching.
Depending on your databases, String matching can support starts/contains/ends/regex for strings.
* Exact matching for other property types.
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[[core.repository-populators]]
= Repository Populators

If you work with the Spring JDBC module, you are probably familiar with the support for populating a `DataSource` with SQL scripts.
A similar abstraction is available on the repositories level, although it does not use SQL as the data definition language because it must be store-independent.
Thus, the populators support XML (through Spring's OXM abstraction) and JSON (through Jackson) to define data with which to populate the repositories.

Assume you have a file called `data.json` with the following content:

.Data defined in JSON
[source,javascript]
----
[ { "_class" : "com.acme.Person",
"firstname" : "Dave",
"lastname" : "Matthews" },
{ "_class" : "com.acme.Person",
"firstname" : "Carter",
"lastname" : "Beauford" } ]
----

You can populate your repositories by using the populator elements of the repository namespace provided in Spring Data Commons.
To populate the preceding data to your `PersonRepository`, declare a populator similar to the following:

.Declaring a Jackson repository populator
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:repository="http://www.springframework.org/schema/data/repository"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/repository
https://www.springframework.org/schema/data/repository/spring-repository.xsd">
<repository:jackson2-populator locations="classpath:data.json" />
</beans>
----

The preceding declaration causes the `data.json` file to be read and deserialized by a Jackson `ObjectMapper`.

The type to which the JSON object is unmarshalled is determined by inspecting the `_class` attribute of the JSON document.
The infrastructure eventually selects the appropriate repository to handle the object that was deserialized.

To instead use XML to define the data the repositories should be populated with, you can use the `unmarshaller-populator` element.
You configure it to use one of the XML marshaller options available in Spring OXM.
See the {spring-framework-docs}/data-access/oxm.html[Spring reference documentation] for details.
The following example shows how to unmarshall a repository populator with JAXB:

.Declaring an unmarshalling repository populator (using JAXB)
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:repository="http://www.springframework.org/schema/data/repository"
xmlns:oxm="http://www.springframework.org/schema/oxm"
xsi:schemaLocation="http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/repository
https://www.springframework.org/schema/data/repository/spring-repository.xsd
http://www.springframework.org/schema/oxm
https://www.springframework.org/schema/oxm/spring-oxm.xsd">
<repository:unmarshaller-populator locations="classpath:data.json"
unmarshaller-ref="unmarshaller" />
<oxm:jaxb2-marshaller contextPath="com.acme" />
</beans>
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[[core.extensions.querydsl]]
= Querydsl Extension

http://www.querydsl.com/[Querydsl] is a framework that enables the construction of statically typed SQL-like queries through its fluent API.

NOTE: Querydsl maintenance has slowed down to a point where the community has forked the project under OpenFeign at https://github.com/OpenFeign/querydsl (groupId `io.github.openfeign.querydsl`).
Spring Data supports the fork on a best-effort basis.

Several Spring Data modules offer integration with Querydsl through `QuerydslPredicateExecutor`, as the following example shows:

.QuerydslPredicateExecutor interface
[source,java]
----
public interface QuerydslPredicateExecutor<T> {
Optional<T> findById(Predicate predicate); <1>
Iterable<T> findAll(Predicate predicate); <2>
long count(Predicate predicate); <3>
boolean exists(Predicate predicate); <4>
// … more functionality omitted.
}
----

<1> Finds and returns a single entity matching the `Predicate`.
<2> Finds and returns all entities matching the `Predicate`.
<3> Returns the number of entities matching the `Predicate`.
<4> Returns whether an entity that matches the `Predicate` exists.

To use the Querydsl support, extend `QuerydslPredicateExecutor` on your repository interface, as the following example shows:

.Querydsl integration on repositories
[source,java]
----
interface UserRepository extends CrudRepository<User, Long>, QuerydslPredicateExecutor<User> {
}
----

The preceding example lets you write type-safe queries by using Querydsl `Predicate` instances, as the following example shows:

[source,java]
----
Predicate predicate = user.firstname.equalsIgnoreCase("dave")
.and(user.lastname.startsWithIgnoreCase("mathews"));
userRepository.findAll(predicate);
----
Loading