Commit Graph

2000 Commits

Author SHA1 Message Date
Julia Lee
27acaa06ba Upgrade to Maven Wrapper 3.9.4.
See #3113
2023-08-14 07:55:27 -04:00
Greg L. Turnquist
73d1760c47 Test against Hibernate 6.3 on CI.
See #3106
2023-08-09 17:03:05 -05:00
Sergey Rukin
ad61fba1f4 Add 'since' headers to Specification javadocs.
See #3102, #3089
2023-08-04 14:48:55 -05:00
Greg L. Turnquist
a5cfcfb157 HQL function names should support schema-based prefixes.
See #3099
2023-08-04 10:26:44 -05:00
Greg L. Turnquist
b5106d1ada TIME should be valid parameter name for JPQL queries.
See #3093
2023-08-02 14:22:05 -05:00
Greg L. Turnquist
34e2331190 FROM and DATE should be usable as parameters in JPQL queries.
See #3092
2023-08-02 13:45:55 -05:00
Greg L. Turnquist
a096ce28bd Verify that mismatched return types are caught.
Verify that when a return type doesn't match the query's type, an exception is thrown.

See #1184
2023-07-26 16:51:47 -05:00
Greg L. Turnquist
a217fc4eeb Make SpEL behavior consistent.
See #1597
2023-07-26 15:14:23 -05:00
Greg L. Turnquist
0e2e5ffaa4 Upgrade to EclipseLink 4.0.2.
See #2900
2023-07-25 15:51:01 -05:00
Greg L. Turnquist
572a77fb4b Polishing.
See #3041
2023-07-21 14:17:10 -05:00
Mark Paluch
a55480f245 Ensure correct bindings for parameter reuse.
We now verify all bindings to ensure that a like-parameter doesn't mix up with plain bindings (e.g. firstname = %:myparam or lastname = :myparam). We also create unique synthetic parameters for positional bindings.

Also, fix Regex to properly detect named, anonymous and positional bind markers.

See #3041
2023-07-21 14:01:15 -05:00
Mark Paluch
c22348153f Revise String Query ParameterBinding.
We now distinguish between the binding parameter target and its origin. The parameter target represents how the binding is bound to the query, the origin points to where the binding parameter comes from (method invocation argument or an expression).

The revised design removes the assumption that binding parameters must match their indices/names of the method call to introduce synthetic parameters for different binding variants while using the same underlying invocation parameters.

See #3041
2023-07-21 14:01:09 -05:00
Mark Paluch
a1e6bbcd98 Use unique named parameter bindings for like parameters.
We now replace LIKE expressions according to their type with individual bindings if an existing binding cannot be used because of how the bound value is being transformed.

WHERE foo like %:name or bar like :name becomes
WHERE foo like :name (i.e. '%' + :name) or bar like :name_1 (i.e. :name)

See #3041
2023-07-21 14:01:00 -05:00
Mark Paluch
5f84e2aa63 Consider Tuples in Keyset extraction.
We now consider Tuple values when the query uses tuples for e.g. interface projections when extracting keyset values.

Closes #3077
2023-07-20 12:03:02 +02:00
Mark Paluch
d6bcdf36e1 After release cleanups.
See #3033
2023-07-14 13:57:59 +02:00
Mark Paluch
d929c3edef Prepare next development iteration.
See #3033
2023-07-14 13:57:57 +02:00
Mark Paluch
6a355ebe9d Release version 3.1.2 (2023.0.2).
See #3033
2023-07-14 13:54:07 +02:00
Mark Paluch
00c727d369 Prepare 3.1.2 (2023.0.2).
See #3033
2023-07-14 13:52:53 +02:00
Greg L. Turnquist
3facc2ae58 Handle != as NOT EQUALS for JPQL.
See #3061.
2023-07-11 10:52:40 -05:00
Greg L. Turnquist
56de051d6f TYPE should be a valid attribute of an entity for a custom query.
See #3062, #3056.
2023-07-10 11:07:22 -05:00
Greg L. Turnquist
49ebc1ab0f Sort properties shouldn't overlap with aliases.
When using an alias in a query, verify using "." as a proper separator against both alias projections as the primary alias to ensure that a Sort property doesn't overlap with an alias.

See #3054
2023-07-05 13:14:23 -05:00
Mark Paluch
f8a0476d0f Update CI properties.
See #3033
2023-07-03 09:48:57 +02:00
Mark Paluch
ea3ed3905f Upgrade to Maven Wrapper 3.9.3.
See #3048
2023-07-03 09:48:17 +02:00
Greg L. Turnquist
742852251a Handle backslash characters for LIKE ESCAPE clause.
Hibernate HQL supports using a `\\` as the ESCAPE character so we need to support it in our custom parser.

See #3040
2023-06-26 13:20:26 -05:00
Mark Paluch
fb4214ca36 Correctly apply OffsetScrollPosition to derived queries.
We now apply the scroll position correctly regardless of whether the query is limited.
Previously, we applied the position only if the query was limited.

Closes #3015
2023-06-26 10:34:03 +02:00
Mark Paluch
6eda785ac7 Reuse parsed SQL statement for alias and projection detection.
Closes #3039
2023-06-26 09:40:02 +02:00
Mark Paluch
f67dd9b655 Backoff JSqlParserQueryEnhancer if query type is not a supported query type.
We now backoff from enhancing queries if the query type is not supported (e.g. TRUNCATE).

Closes #3038
2023-06-26 09:40:01 +02:00
John Blum
bcddc94c85 After release cleanups.
See #2949
2023-06-16 08:13:30 -07:00
John Blum
bb1fcd7974 Prepare next development iteration.
See #2949
2023-06-16 08:13:28 -07:00
John Blum
35fd2995a2 Release version 3.1.1 (2023.0.1).
See #2949
2023-06-16 08:05:36 -07:00
John Blum
4506406749 Prepare 3.1.1 (2023.0.1).
See #2949
2023-06-16 08:05:06 -07:00
Greg L. Turnquist
05d4930dc7 Upgrade to Hibernate 6.2.4.Final.
See #3029
2023-06-15 14:37:20 -05:00
Greg L. Turnquist
7f9783c87e Handle VALUE function properly in JPQL queries.
See #3028
2023-06-15 14:30:22 -05:00
Yanming Zhou
cd1587ba1b Polishing.
delegate.getResultWindow() the first time it's called in this method already produces a limit-sized result set, captured in resultsToUse. Running it through the same getResultWindow a second time in unnecessary.

Original Pull Request: #3021
2023-06-15 11:46:12 -05:00
Mark Paluch
32f876ee07 Polishing.
See #2998
2023-06-15 15:12:49 +02:00
Yanming Zhou
f25c24fbef Remove synthetic attribute from SharedEntityManager.
AOT no longer needs this bean to be synthetic to work properly. And this attribute hampers BeanPostProcessors from being applied.

See #2730
Original Pull Request: #2866
2023-06-14 16:04:24 -05:00
Greg L. Turnquist
572efd28a9 Handle dateTimeField property with HQL.
Hibernate supports varisous duration literals. They also support a couple formats for binary literals.

See #3025
2023-06-14 14:52:03 -05:00
Greg L. Turnquist
0d03612633 Properly handle CAST functions on HQL.
See #3024
2023-06-14 12:17:39 -05:00
Mark Paluch
3132f4945b Retain scroll direction in Keyset position function of the correct item.
Closes #2999
2023-06-13 10:27:27 +02:00
Mark Paluch
c06cc38397 Polishing.
Move spring-instrument into test dependencies to eagerly resolve the dependency instead of using plugin-repositories.

See #2998
2023-06-13 09:30:31 +02:00
Mark Paluch
e641c4f0de Upgrade to Maven Wrapper 3.9.2.
See #3018
2023-06-13 08:53:54 +02:00
Greg L. Turnquist
a6e33ad1b9 Properly handle Sort's that start with a join alias.
JOIN clauses can have aliases as well, despite not using an AS reserved word. The HQL query parser needs to handle this.

See #2960, #1066, #664
Original Pull Request: 2967
2023-06-12 16:08:28 -05:00
Greg L. Turnquist
107e4c174f Add section to reference docs highlighting other possibilities.
Give users that have too complex of a query a list of where to go should Spring Data JPA not offer what they need in query support.

See #3005
Original Pull Request: #3006
2023-06-09 14:06:43 -05:00
Mark Paluch
4b63d4d11f Avoid duplicate sort orders through Keyset scrolling.
We now avoid adding sort properties if they are already specified by Sort.

Closes #2996
2023-06-08 09:47:47 +02:00
Mark Paluch
f70e74fd1d Use snapshot and milestone repositories instead of libs-snapshot and libs-milestone.
Closes #2998
2023-06-06 10:05:18 +02:00
Greg L. Turnquist
9fe908d348 Handle SIGN function properly in HQL and JPQL queries.
See #2994.
2023-06-02 14:36:15 -05:00
Mark Paluch
2df06bd736 Polishing.
Reuse comment hint retrieval. Reorder methods. Inline methods and use fluent API where possible.

See #2991
Original pull request: #2995
2023-06-02 14:36:20 +02:00
Yanming Zhou
168d7d56d3 Add missing null check for metadata.
1. null check on variable `metadata` is missing in method `existsById`
2. `CrudMethodMetadata::getComment` should be `@Nullable`

Closes #2991
Original pull request: #2995
2023-06-02 14:36:20 +02:00
Greg L. Turnquist
280726fe2b Verify that projections work with subqueries.
Interface-based projections used to NOT work when the query had a subquery in it. But with the new query parser, it already handles it. So this simply captures the test providing that corner case.

See #2008
Original Pull Request: #420
2023-06-01 10:44:21 -05:00
Greg L. Turnquist
1f28c61247 Resolve handling of ESCAPE clause with LIKE queries on EclipseLink.
Migrate tests to H2 to verify LIKE with ESCAPE works properly on EclipseLink with Spring Data JPA.

Resolves #2955
Original Pull Request: #2956.
2023-05-31 09:08:47 +02:00