Commit Graph

2508 Commits

Author SHA1 Message Date
Mark Paluch
ea9e6e15bb Refine DTO projection rewriting.
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 #3895
2025-06-04 09:16:22 +02:00
Mark Paluch
205912ccc2 Fix potential class-cast exception.
See #3895
2025-06-04 09:04:23 +02:00
Mark Paluch
2f620400d5 Do not consider JPA-managed types projections.
We now back off from rewriting queries to constructor expressions if a returned type is a JPA-managed one.

See #3895
2025-06-04 08:46:29 +02:00
Mark Paluch
6cb02db8c6 Refrain from rewriting queries without input properties.
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 #3895
2025-06-04 08:45:31 +02:00
Mark Paluch
b37a334549 Avoid capturing ?& and ?| as bind parameter markers.
We now exclude  `?&` and `?|` from being matched as JDBC-style parameter bind marker.

Closes #3907
2025-06-03 16:56:54 +02:00
Christoph Strobl
1cad9074fd Resolve deprecation warnings in JpaRuntimeHints.
See: #3905
2025-06-02 10:31:21 +02:00
Christoph Strobl
d3e088f5b9 Add missing reflection hint for DefaultQueryEnhancerSelector.
Closes: #3905
2025-06-02 10:29:00 +02:00
Christoph Strobl
936bb31f3a Upgrade to Hibernate 7.0 Final.
Closes: #3896
2025-05-21 13:47:07 +02:00
Mark Paluch
c35e30ed52 After release cleanups.
See #3854
2025-05-16 14:18:48 +02:00
Mark Paluch
7bfb527179 Prepare next development iteration.
See #3854
2025-05-16 14:18:46 +02:00
Mark Paluch
5df7b98122 Release version 4.0 M3 (2025.1.0).
See #3854
2025-05-16 14:16:17 +02:00
Mark Paluch
e063f1691e Prepare 4.0 M3 (2025.1.0).
See #3854
2025-05-16 14:15:56 +02:00
Mark Paluch
3f17014b9f Capture @EnableJpaRepositories configuration for AOT processing.
Closes #3838
2025-05-16 12:25:59 +02:00
Mark Paluch
88da07e555 Polishing.
Move off deprecated API.

See #3887
2025-05-16 12:25:59 +02:00
Mark Paluch
438de0c2e0 Upgrade to Hibernate 7.0 CR2.
Closes #3887
2025-05-16 12:25:59 +02:00
Mark Paluch
eeca4df36f Detect PersistenceUnitManager and PersistenceManaged types in JpaRepositoryContributor.
See #3875
2025-05-16 12:25:59 +02:00
Mark Paluch
01eb2b833d Polishing.
Reuse setReturningFunction and genericFunctionArguments structure for easier extension. Split fromRoot into separate parser function fragments.

Fix trailing spaces.

See: #3864
Original pull request: #3879
2025-05-16 12:25:59 +02:00
oscarfanchin
2ebe4caba6 Add support for Set-Returning Functions (SRF) to HQL parser and query rendering.
Signed-off-by: oscarfanchin <oscar.fanchin@gmail.com>

Closes: #3864
Original pull request: #3879
2025-05-16 12:25:59 +02:00
Mark Paluch
85fcbcd2fb Support HQL LIMIT/OFFSET without ordering.
Closes #3882
2025-05-16 12:25:59 +02:00
Mark Paluch
6bffef2a58 Polishing.
See #3868
2025-05-16 12:25:58 +02:00
Mark Paluch
50113038aa Fix EQL and JPQL LIKE with ESCAPE clause parsing.
Closes #3873
2025-05-16 12:25:58 +02:00
Mark Paluch
c96bf905b2 Upgrade to Oracle OJDBC 23.8.0.25.04.
Closes #3881
2025-05-16 12:25:58 +02:00
Mark Paluch
8556a7b968 Update CI Properties.
See #3854
2025-05-16 12:25:58 +02:00
Christoph Strobl
e802143baf Polishing.
Original Pull Request: #3868
2025-05-16 12:25:58 +02:00
Mark Paluch
17a59905a7 Explore returning Search Results.
Closes: #3868
2025-05-16 12:25:58 +02:00
Mark Paluch
e6a008cf08 Fix JPQL and EQL CAST(…) function parsing.
We now define arithmetic, string, and typed cast functions to support all potential variants of casting supported by JPQL and EQL.

Closes #3863
2025-05-16 12:25:58 +02:00
Mark Paluch
b66c96d363 Use SelectionQuery.getResultCount() for count queries if possible.
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
2025-05-16 12:25:57 +02:00
Mark Paluch
219e5c58e4 Fliter jakarta.persistence types from AOT Metamodel.
Otherwise, Hibernate fails with weird resolution errors.

See #3872
2025-05-16 12:25:57 +02:00
Mark Paluch
01e4e75617 Use isolated Hibernate EntityManager for AOT contribution.
Closes #3876
2025-05-16 12:25:57 +02:00
Mark Paluch
e1cec313f3 Use LocalVariableNameFactory in repository contributor.
Closes #3875
2025-05-16 12:25:57 +02:00
Mark Paluch
65214fb0b1 Provide JpaRepositoryFragmentsContributor in JPA Repository Factory and Repository Factory Bean.
Closes #3874
2025-05-16 12:25:57 +02:00
Christoph Strobl
eb4ad0923d Upgrade to Hibernate 7.0.0.CR1.
Closes: #3872
2025-05-16 12:25:57 +02:00
Mark Paluch
7f20f10b30 Polishing.
Introduce doWithPlainSelect(…) callback for easier filtering of Select subtypes. Add test for known (previously) failing case.

See: #3869
Original pull request: #3870
2025-05-16 12:25:56 +02:00
Diego Pedregal
b3c0210f17 Removes PlainSelect casting in JSqlParserQueryEnhancer.
Closes: #3869
Original pull request: #3870

Signed-off-by: Diego Pedregal <diego.p.hidalgo@gmail.com>
2025-05-16 12:25:56 +02:00
Mark Paluch
2435807db4 Avoid DTO Constructor Expression rewriting for selection of nested properties.
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
2025-05-16 12:25:56 +02:00
Mark Paluch
41bfd415ca Polishing.
Add fix to Update, Delete, and PredicateSpecification. Reformat code. Refine tests.

See #3849
Original pull request: #3856
2025-05-16 12:25:56 +02:00
SWQXDBA
dc854df741 Fix handling of null predicate in Specification.not().
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>
2025-05-16 12:25:56 +02:00
Mark Paluch
5ebfdb6566 Polishing.
Add dynamic projection benchmark.
2025-05-16 12:25:56 +02:00
Mark Paluch
403e1b4d01 Use parameter names in derived JPQL queries.
We also use improved parameter naming for keyset queries for easier correlation of values.

Closes #3857
2025-05-16 12:25:56 +02:00
Mark Paluch
ddeac0cacd After release cleanups.
See #3751
2025-05-16 12:25:55 +02:00
Mark Paluch
c57ee667bf Prepare next development iteration.
See #3751
2025-05-16 12:25:55 +02:00
Mark Paluch
68fb398b4b Release version 4.0 M2 (2025.1.0).
See #3751
2025-05-16 12:25:55 +02:00
Mark Paluch
8ac384c96e Prepare 4.0 M2 (2025.1.0).
See #3751
2025-05-16 12:25:55 +02:00
Mark Paluch
fe3c22dad0 Polishing.
Fix post-rebase conflicts.

See #3622
2025-05-16 12:25:55 +02:00
hgh1472
1781819e59 Remove unnecessary parameter.
Remove unnecessary boolean nativeQuery from checkHasNamedParameter of StringQueryUnitTests class.

Signed-off-by: hgh1472 <hgh1472@naver.com>

Closes #3827
Original pull request: #3828
2025-05-16 12:25:55 +02:00
Christoph Strobl
0e7aef080f Remove hardcoded repository fragment from test setup.
See #3830
2025-05-16 12:25:55 +02:00
Mark Paluch
fbd214f72e Polishing.
Run AotMetamodel against live EntityManagerFactory, use Environment to check for AOT repository enabled flag.

See #3830
2025-05-16 12:25:54 +02:00
Mark Paluch
eb1266888f Add support for JSON repository metadata.
See #3830
2025-05-16 12:25:54 +02:00
Mark Paluch
be4d8528b3 Add AOT repository benchmarks.
See #3830
2025-05-16 12:25:54 +02:00
Mark Paluch
d3cc7da3d9 Add support for QueryRewriter.
See #3830
2025-05-16 12:25:54 +02:00