Skip to content

Backport Specification.unrestricted() #3940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from

Conversation

r-gruber
Copy link

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

mp911de and others added 30 commits May 16, 2025 11:31
Also, document the intent to make methods accepting `Specifications` to be non-nullable.

Closes spring-projects#3893
We now exclude  `?&` and `?|` from being matched as JDBC-style parameter bind marker.

Closes spring-projects#3907
We now no longer attempt to rewrite the query if the target type doesn't define input properties (no-args constructor or multiple constructors).

Closes spring-projects#3895
We now back off from rewriting queries to constructor expressions if a returned type is a JPA-managed one.

See spring-projects#3895
We now consider dropping aliases (count(foo) as foo), support subselects and capture individual select items to avoid contextual information loss.

Also, added a series of tests to cover edgecases.

See spring-projects#3895
We now only consider top-level properties for tuple query selection to avoid join products caused by selecting nested relationships.

Closes spring-projects#3908
Move warning suppression to the class-level.

See spring-projects#3901
Revise PersistenceProvider detection to a EntityManagerFactory-based variant, considering EntityManagerFactory proxying.

See: spring-projects#3425
Original pull request: spring-projects#3885
Remove leading space requirement, simplify group nesting and replace character class with non-capturing group to avoid a, s and | (pipe) matching.

Closes spring-projects#3911
Remove type parameter to enable usage with Hibernate 6.2.

See: spring-projects#3425
Original pull request: spring-projects#3885
Simplify regex.

See spring-projects#3911
Refine readme.

See spring-projects#3892
We now distinguish between Spring-proxied and other JDK proxied EntityManagerFactory objects for proper unwrapping. Spring consistently uses a null value as class to get hold of the target object.

Both, Hibernate and EclipseLink fail with a NullPointerException when calling unwrap(null) and therefore, we call all other JDK proxies with unwrap(EntityManagerFactory.class) to adhere to the JPA specification and avoid failures according to the implementations.

Any other proxying mechanism that behaves differently will require additional refinement once such a case comes up.

Closes spring-projects#3923
Remove additional Eclipselink build steps as we don't use these.

See spring-projects#3892
…writing.

We now verify that we can actually express a valid constructor expression before rewriting queries to use constructor expressions.

See spring-projects#3929
Refine conditional flow.

See spring-projects#3932
Cache the deleteAll and count query strings as final fields in SimpleJpaRepository.
This avoids repeated String.format operations and reduces unnecessary object creation
on every invocation of deleteAllInBatch() and count(). No functional changes.

Signed-off-by: Giheon Do <[email protected]>
Closes spring-projects#3920
mp911de and others added 4 commits July 10, 2025 12:21
Inline methods, lazify query creation.

See spring-projects#3920
This would allow 3.5 users to rework their code ahead of the 4.0 release. 'where(null)' was deprecated and should be replaced with unrestricted()
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 14, 2025
@r-gruber
Copy link
Author

Sorry, i miss clicked to wrong target branch :(

@r-gruber r-gruber closed this Jul 14, 2025
@r-gruber r-gruber deleted the backport_unrestricted branch July 14, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants