Commit Graph

626 Commits

Author SHA1 Message Date
Juergen Hoeller
7a1dfe79a0 Polishing (aligned with 6.2.x) 2025-03-21 16:08:02 +01:00
Juergen Hoeller
95003e3512 Avoid logger serialization behind shared EntityManager proxy
See gh-34084
2024-12-12 19:52:21 +01:00
Sébastien Deleuze
c28a0d5627 Add missing hints for Hibernate @TenantId
Closes gh-32967
2024-06-06 10:04:35 +02:00
Sébastien Deleuze
f6b608eecb Consistently support Hibernate annotation hint inference on methods
See gh-32842
2024-06-04 16:46:25 +02:00
Sébastien Deleuze
4da1511ed3 Infer hints for Hibernate generators
This commit updates
PersistenceManagedTypesBeanRegistrationAotProcessor
in order to infer hints for Hibernate annotations meta
annotated with `@ValueGenerationType` (like `@CreationTimestamp`)
and `@IdGeneratorType`.

`@GenericGenerator` is not supported as it is deprecated as of
Hibernate 6.5.

Closes gh-32842
2024-06-04 16:46:25 +02:00
Juergen Hoeller
65e1337d35 Polishing 2024-05-21 11:16:25 +02:00
Juergen Hoeller
4f02be263f Polishing 2024-05-07 15:52:13 +02:00
Juergen Hoeller
59a125d06f Unwrap raw target Query instance in case of proxy mismatch
Closes gh-32766
2024-05-06 20:09:43 +02:00
Sébastien Deleuze
290a41d398 Refine null-safety in more modules
This commit refines the null-safety in all remaining modules
except spring-test.

See gh-32475
2024-03-26 15:39:18 +01:00
Sébastien Deleuze
1b563f8ba4 Refine null-safety in more modules
This commit refines the null-safety in:
 - spring-jdbc
 - spring-r2dbc
 - spring-orm
 - spring-beans
 - spring-aop

See gh-32475
2024-03-26 09:46:34 +01:00
Juergen Hoeller
c531a8a705 Nullability refinements and related polishing
See gh-32475
2024-03-19 09:58:44 +01:00
Juergen Hoeller
f22a1eece4 Polishing 2024-02-28 19:14:37 +01:00
Sébastien Deleuze
9430b24eaf Adapt Hibernate native support for HHH-17643
This commit adapts Hibernate native support to handle
the changes performed as part of HHH-17643 which impacts
Hibernate versions 6.4.3+ and 6.2.21+.

It ignores the BytecodeProvider services loaded by the
service loader feature in order to default to the
"no-op" provider with native, and makes the substitutions
more lenient when a substituted field or method does not
exist.

gh-32314 is expected to remove the need for such
substitutions which are not great for maintainability
by design.

Closes gh-32311
2024-02-22 16:30:32 +01:00
Stéphane Nicoll
b55a4d3908 Prevent AOT from failing with spring-orm without JPA
This commit improves PersistenceManagedTypesBeanRegistrationAotProcessor
so that it does not attempt to load JPA classes when checking for the
presence of a PersistenceManagedTypes bean. To make it more clear a
check on the presence for JPA has been added to prevent the nested
classes to be loaded regardless of the presence of the bean.

Closes gh-32155
2024-01-30 15:43:07 +01:00
Juergen Hoeller
00bda65848 Polishing 2024-01-19 17:09:58 +01:00
Stéphane Nicoll
472dcdb59c Allow JPA entities to be filtered
This commit provides more control over JPA entities scanning by allowing
the result to be filtered.

Closes gh-27892
2024-01-19 15:38:53 +01:00
Stéphane Nicoll
0c42965fc3 Polish 2024-01-15 11:17:19 +01:00
Stéphane Nicoll
1f2d29ee08 Polish 2024-01-08 17:12:33 +01:00
Stéphane Nicoll
2d3b02a89d Polish 2024-01-08 11:48:08 +01:00
Stéphane Nicoll
9f3fd103ef Polish 2023-12-30 11:17:49 +01:00
Stéphane Nicoll
699f93fed7 Use proper SQLServer dialect for Hibernate 6+
This commit fixes the Hibernate dialect lookup for SQLServer as it was
previously using a dialect that has been deprecated. In recent
versions, the standard SQLServerDialect is the one we should be using.

Closes gh-31896
2023-12-26 14:03:20 +01:00
Stéphane Nicoll
0390709577 Use proper Oracle dialect for Hibernate 6+
This commit fixes the Hibernate dialect lookup for Oracle as it was
previously using a dialect that has been moved and deprecated to a
separate project. In recent versions, the standard OracleDialect is the
one we should be using.

Closes gh-31892
2023-12-22 15:22:01 +01:00
Stéphane Nicoll
9f2970bc5c Use non deprecated MySQL dialect for Hibernate 6+
This commit fixes the Hibernate dialect lookup for MySQL as it was
previously using a deprecated dialect that has been removed in the most
recent Hibernate version.

Closes gh-31889
2023-12-22 15:03:40 +01:00
Sébastien Deleuze
43c2e51d6e Document BytecodeProviderImpl substitution related issue
See gh-29549
See gh-31051
2023-12-14 15:37:43 +01:00
Juergen Hoeller
361dfd1ae4 Polishing 2023-12-09 23:51:18 +01:00
Juergen Hoeller
c57b7e8418 Introduce ClassFormatException and spring.classformat.ignore property
Closes gh-27691
2023-12-09 20:03:57 +01:00
Brian Clozel
61dd9fce73 Revert ValidationMode.CALLBACK on JPA bootstrap
In gh-30549 we applied changes to the `DefaultPersistenceUnitManager` to
use the `ValidationMode.CALLBACK` to better detect invalid validation
setup and enforce bootstrap failures in those cases.

Unfortunately, doing so disables the detection of validation annotation
on entities during the schema creation phase. This is a known Hibernate
issue. This commit reverts this change until HHH-12287 is fixed.

Fixes gh-31726
2023-12-06 18:34:42 +01:00
Yanming Zhou
afcd03bddc Replace assertThat(x.isEmpty()).isTrue() with assertThat(x).isEmpty()
Search for   : assertThat\((.+).isEmpty\(\)\).isTrue\(\)
Replace with : assertThat($1).isEmpty()

Search for   : assertThat\((.+).isEmpty\(\)\).isFalse\(\)
Replace with : assertThat($1).isNotEmpty()

Closes gh-31758
2023-12-06 10:04:56 +01:00
Yanming Zhou
7b16ef90f1 Replace assertThat(x.equals(y)) with assertThat(x).isEqualTo(y)
Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isTrue\(\)
Replace with : assertThat($1).isEqualTo($2)

Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isFalse\(\)
Replace with : assertThat($1).isNotEqualTo($2)

Closes gh-31763
2023-12-06 09:50:15 +01:00
Yanming Zhou
66e405525b Replace assertThat(x instanceof y).isTrue() with assertThat(x).isInstanceOf(y.class)
Search for   : assertThat\((.+) instanceof (\w+)\)\.isTrue\(\)
Replace with : assertThat($1).isInstanceOf($2.class)

Search for   : assertThat\((.+) instanceof (\w+)\)\.isFalse\(\)
Replace with : assertThat($1).isNotInstanceOf($2.class)

Closes gh-31760
2023-12-06 09:46:44 +01:00
Yanming Zhou
59815cefce Replace assertThat(x.get(i)). with assertThat(x).element(i).
Search for   : assertThat\((.+)\.get\((\d+)\)\)\.
Replace with : assertThat($1).element($2).

Closes gh-31759
2023-12-06 09:43:59 +01:00
Stéphane Nicoll
1da40b84e7 Polish "Use idiomatic AssertJ map assertions"
See gh-31752
2023-12-05 10:39:33 +01:00
Sam Brannen
62b3d7a963 Update copyright headers 2023-12-04 16:47:25 +01:00
Sam Brannen
d71853f105 Polish contribution
See gh-31531
2023-12-04 16:47:25 +01:00
Yanming Zhou
490b5c77fc Use switch expression where feasible 2023-12-04 15:42:55 +01:00
Sam Brannen
6ea9fdbf77 Polishing 2023-11-30 19:04:59 +01:00
Sam Brannen
a15f472898 Include scroll() in SharedEntityManagerCreator's queryTerminatingMethods
This commit supports the scroll() and scroll(ScrollMode) methods from
Hibernate's Query API in SharedEntityManagerCreator's query-terminating
methods set.

Closes gh-31682
2023-11-26 12:12:54 +01:00
Sébastien Deleuze
183c2f82b2 Refine @EmbeddableInstantiator reflection hints
Based on @odrotbohm proposal to manage a wider set
of use cases.

Closes gh-31534
2023-11-15 18:48:27 +01:00
Sébastien Deleuze
9d6bda2b44 Register Hibernate @EmbeddableInstantiator reflection hints
This commit updates PersistenceManagedTypesBeanRegistrationAotProcessor
to register reflection hints for `@EmbeddableInstantiator` annotations
available as of Hibernate 6.0 when needed.

Related tests will be added in
https://github.com/spring-projects/spring-aot-smoke-tests.

Closes gh-31534
2023-11-07 11:04:43 +01:00
Johnny Lim
2b750926c3 Polishing
Closes gh-31522
2023-10-30 15:05:20 +01:00
Dmitrii Bocharov
ce778cee27 Fix spring-orm tests with eclipselink and Java 18+
See gh-31078
2023-10-24 16:49:58 +02:00
Johnny Lim
64e9fcad53 Apply SingleSpaceSeparator Checkstyle module
This commit also fixes its violations.

Closes gh-31469
2023-10-22 14:09:57 +02:00
Misagh Moayyed
1e7e532ed6 Fix typos in SubstituteOnlyIfPresent Javadoc
Closes gh-31455
2023-10-18 14:11:44 +02:00
Sébastien Deleuze
a9d67878c5 Introduce conditional activation of Hibernate substitutions
Closes gh-31452
2023-10-18 12:16:58 +02:00
Johnny Lim
919faa2ce2 Order modifiers to align with JLS
This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
2023-10-17 16:13:56 +02:00
Juergen Hoeller
653a631df5 Merge branch '6.0.x'
# Conflicts:
#	spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaDialect.java
2023-10-11 13:28:11 +02:00
Juergen Hoeller
66ce8c9a25 Properly return SQLExceptionTranslator-provided exception
Closes gh-31409
2023-10-11 13:13:22 +02:00
Juergen Hoeller
e76b453685 Translate Hibernate TransactionException through SQLException cause
Closes gh-31274
2023-10-11 13:09:19 +02:00
Juergen Hoeller
a3e13c8ba8 Merge branch '6.0.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/util/backoff/ExponentialBackOff.java
2023-09-29 15:01:43 +02:00
Juergen Hoeller
407113945d Polishing 2023-09-29 14:58:02 +02:00