Commit Graph

1985 Commits

Author SHA1 Message Date
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
Greg L. Turnquist
14642a5869 Resolve handling of ESCAPE clause with LIKE queries on Hibernate.
The HQL parser has to handle parameters in addition to character values in order to support SpEL.

Closes #2954
Original Pull Request: #2956.
2023-05-31 09:08:46 +02:00
Greg L. Turnquist
199317bf70 Upgrade to Postgres 11 for integration testing.
Postgres stored procedures requires some adjustments in order to upgrade to Postgres 11.

See #2903
2023-05-30 11:14:08 -05:00
Mark Paluch
8c7b469591 Polishing.
Simplify code flow. Introduce flag to capture whether a stored procedure uses collection return types.

Remove unconditionally the Optional converter as we're already on Java 17 and do not require the Java 8 guard.

See #2915
Original pull request: #2938
2023-05-30 15:05:56 +02:00
Greg L. Turnquist
32c8951a93 Close StoredProcedureQuery if it implements AutoCloseable.
If the JPA provider's implementation of StoredProcedureQuery implements AutoCloseable, invoke the close method when completed.

Resolves #2915.
Original pull request: #2938
2023-05-30 15:05:56 +02:00
Greg L. Turnquist
0f8279bbfa Properly handle reserved words as entity names.
In JPQL and HQL, we need to properly handle reserved words that crop up as entity names (which is legal).

See #2982.
2023-05-26 14:46:06 -05:00
Greg L. Turnquist
ad7b28063a Support Common Table Expressions in HQL parser.
See #2981.
2023-05-26 13:55:24 -05:00
Mark Paluch
bec9809f95 Polishing.
Remove unnecessary property declarations.

Original pull request: #2974
See #2973.
2023-05-26 10:26:25 +02:00
Greg L. Turnquist
ccad51bde9 Migrate to org.codehaus.mojo:aspectj-maven-plugin.
Closes #2973.
Original pull request: #2974
2023-05-26 10:26:25 +02:00
Greg L. Turnquist
d6f368dcfb Handle subqueries when used inside HQL INSERT statements.
Potentialy subqueries can crop up inside INSERT statements. We need to handle this as well.

NOTE: INSERT statements aren't defined in JPQL, so this problem doesn't overlap with standard JPA queries.

See #2977
2023-05-24 14:46:32 -05:00
Greg L. Turnquist
6d56a2525c Support alternative NOT EQUALS operators in HQL.
Hibernate also supports "!=" and "^=" as NOT EQUALS operators.

See #2970
Original Pull Request #2972
2023-05-23 08:56:27 -05:00
Greg L. Turnquist
e973c275ed HQL queries without a primary alias don't need Sorted properties prefixed.
If a Hibernate query doesn't have a primary alias, don't attempt to prefix any Sort properties using it.

See #2969
Original Pull Request #2971
2023-05-23 08:33:43 -05:00
Greg L. Turnquist
1c7a19a054 ROUND doesn't need to be a reserved word.
Because ROUND is a reserved word yet is NOT on the list of approved functions, it fails to get parsed. Simply dropping it from the list of reserved words makes it succeed in the HQL query parser.

See #2964
Original Pull Request: #2966
2023-05-22 15:32:22 -05:00
Greg L. Turnquist
da37737c22 Properly implement handling sort items.
See #2962
Original Pull Request: #2965
2023-05-22 15:32:16 -05:00
Mark Paluch
cc901527cf Update Jenkins triggers after GA release.
See #2919
2023-05-12 14:42:45 +02:00
Mark Paluch
2e6676e5e9 Update Jenkins triggers after GA release.
See #2919
2023-05-12 14:41:42 +02:00