Skip to content

Add delete(Predicate) to QuerydslJpaPredicateExecutor #3878

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

Open
wants to merge 94 commits into
base: 4.0.x
Choose a base branch
from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented May 9, 2025

We now define a delete method to remove entities using a Querydsl Predicate and return the count of deleted elements.

Closes #3877

mp911de and others added 30 commits April 14, 2025 09:03
Introduce new DSL to construct JPQL queries. Refactor ParameterMetadata to PartTreeParameterBinding.

Disable Keyset pagination with projections for Eclipselink as Eclipselink doesn't consider type hints for JPQL queries.

Closes #3588
Original pull request: #3653
Make usage of ParameterExpression more explicit. Add JPQL rendering tests.
Favor Metamodel over From for building jpql queries.
Align IsNull and IsNotNull handling.
Support Derived Delete and Exists, consider null values when caching queries.

See #3588
Original pull request: #3653
Remove method overloads accepting pure strings. Use switch-expressions. Correctly navigate nested joins. Introduce PathExpression interface, refine naming.

See #3588
Original pull request: #3653
See #3588
Original pull request: #3653
Closes: #3673
Original Pull Request: #3695
Closes: #3671
Original Pull Request: #3695
Closes: #3672
Original Pull Request: #3695
Inline select_query into select_statement, simplify set_function resolution.
Align JPQL and EQL grammars.
Adopt Hibernate version guards in tests.

Original Pull Request: #3695
Remove unused methods. Introduce QueryTokenStream.from and QueryTokenStream.ofToken() factory methods. Migrate JPQL visitors to consistently return token streams instead of mixing expression streams when obtaining values from nodes/terminal nodes.

Remove also unused concat methods for consistency.

We now instead decide on the composition (calling) site whether a token (stream) should be inlined, an expression or used as-is.

Original Pull Request: #3695
We now use getSingleResultOrNull() to avoid NoResultException handling.

Closes: #3701
Original Pull Request: #3695
Favour java.time types for auditing by switching from Date to Instant.

See: #3673
Original Pull Request: #3695
A round of minor code style improvements.

Original Pull Request: #3695
Introduce DeleteSpecification and UpdateSpecification. Add PredicateSpecification. Update SpecificationExecutor.

Closes: #3521
Original Pull Request: #3578
Also remove serialVersionUID.

Original Pull Request: #3578
Revise nullability requirements around non-nullable specifications.

Original Pull Request: #3578
Original Pull Request: #3578
Original Pull Request: #3578
Refine JOIN and function keyword rendering.

See #3692
mp911de and others added 23 commits April 22, 2025 10:37
Fix post-rebase conflicts.

See #3622
Refine documentation.

See #3815
We also use improved parameter naming for keyset queries for easier correlation of values.

Closes #3857
Add dynamic projection benchmark.
When toPredicate() returns null, Specification.not() now returns
builder.disjunction() instead of builder.not(null). This change
ensures proper handling of null predicates in negated specifications.

Closes #3849
Original pull request: #3856

Signed-off-by: SWQXDBA <983110853@qq.com>
Add fix to Update, Delete, and PredicateSpecification. Reformat code. Refine tests.

See #3849
Original pull request: #3856
…operties.

We back off from rewriting String-based queries to use DTO Constructor expressions if the query selects a property that is assignable to the return type.

Closes #3862
Closes: #3869
Original pull request: #3870

Signed-off-by: Diego Pedregal <diego.p.hidalgo@gmail.com>
Introduce doWithPlainSelect(…) callback for easier filtering of Select subtypes. Add test for known (previously) failing case.

See: #3869
Original pull request: #3870
Signed-off-by: Lidoca <32785562+Lidoca@users.noreply.github.com>

Closes #3859
Merge Openfeign setup tabs.

See #3859
Otherwise, Hibernate fails with weird resolution errors.

See #3872
We now use Hibernate's built-in mechanism to obtain the result count if there is an enclosing transaction. Without the transaction, the session is being closed and we cannot run the query.

Closes #3456
@mp911de mp911de added the type: enhancement A general enhancement label May 9, 2025
@mp911de mp911de linked an issue May 9, 2025 that may be closed by this pull request
We now define a delete method to remove entities by a Querydsl Predicate and return the count of deleted elements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add delete(Predicate) to QuerydslJpaPredicateExecutor
10 participants