Commit Graph

433 Commits

Author SHA1 Message Date
Stéphane Nicoll
35dea59ce4 Polish "Prevent further configuration once SqlCall is compiled"
See gh-33729
2025-02-04 15:45:18 +01:00
Dan Sievewright
8810913f30 Prevent further configuration once SqlCall is compiled
This commit prevents AbstractJdbcCall to be further configured once it
is compiled.

See gh-33729
2025-02-04 15:43:01 +01:00
Brian Clozel
d28c0396c9 Update runtime hints predicates after GraalVM changes
As of gh-33847, method and field introspection is included by default
when a type is registered for reflection.
Many methods in ReflectionHintsPredicates are now mostly useless as their
default behavior checks for introspection.

This commit deprecates those methods and promotes instead invocation
variants. During the upgrade, developers should replace it for an
`onType` check if only reflection is required. If they were checking for
invocation, they should use the new 'onXInvocation` method.

Closes gh-34239
2025-01-13 15:34:34 +01:00
Sébastien Deleuze
bc5d771a06 Switch to JSpecify annotations
This commit updates the whole Spring Framework codebase to use JSpecify
annotations instead of Spring null-safety annotations with JSR 305
semantics.

JSpecify provides signficant enhancements such as properly defined
specifications, a canonical dependency with no split-package issue,
better tooling, better Kotlin integration and the capability to specify
generic type, array and varargs element null-safety. Generic type
null-safety is not defined by this commit yet and will be specified
later.

A key difference is that Spring null-safety annotations, following
JSR 305 semantics, apply to fields, parameters and return values,
while JSpecify annotations apply to type usages. That's why this
commit moves nullability annotations closer to the type for fields
and return values.

See gh-28797
2024-12-19 11:07:23 +01:00
youable
5494d78018 Polish
See gh-33891
2024-12-10 07:47:42 +01:00
Sam Brannen
f5c3f3522e Simplify @⁠EnumSource usage 2024-11-18 14:12:13 +01:00
Juergen Hoeller
df5489b81a Introduce optionalValue() method on ResultQuerySpec
Closes gh-33560
2024-09-20 19:16:02 +02:00
Sam Brannen
d749d2949d Use new features from JUnit Jupiter 5.11
This commit primarily migrates to the new argumentSet() feature but also
applies additional polishing to our use of parameterized tests.

See gh-33395
2024-08-16 13:48:19 +02:00
Stéphane Nicoll
e27192e8ad Merge branch '6.1.x' 2024-08-12 11:02:07 +02:00
Stéphane Nicoll
749145be2a Polish "Fix predicate setup in test"
See gh-33368
2024-08-12 10:29:34 +02:00
tafjwr
28eece3da1 Fix predicate setup in test
See gh-33368
2024-08-12 10:29:23 +02:00
Stéphane Nicoll
67838f3ff9 Provide all counters in BatchUpdateException
This commit updates JbcTemplate#batchUpdate to provide additional
information when one batch fails. Previously, the raw
BatchUpdateException was thrown with no way to know what had completed
thus far.

This commit creates an AggregatedBatchUpdateException that wraps the
original BatchUpdateException, yet providing the counters of the batches
that ran prior to the exception. In essence, this represents the same
state as the return value of the method if no batch fails.

AggregateBatchUpdateException exposes the original BatchUpdateException
in advanced case, such as checking for a sub-class that may contain
additional information.

Closes gh-23867
2024-08-08 08:35:06 +02:00
Stéphane Nicoll
181b68088a Merge branch '6.1.x' 2024-05-23 08:14:59 +02:00
Stéphane Nicoll
c01aab5850 Polish
See gh-32874
2024-05-23 08:12:30 +02:00
Juergen Hoeller
e42c5ca52b Merge branch '6.1.x' 2024-04-18 12:20:14 +02:00
Juergen Hoeller
0e0397a385 Polishing 2024-04-18 12:18:18 +02:00
Stéphane Nicoll
e53ed3e3c6 Merge branch '6.1.x' 2024-03-09 16:03:04 +01:00
Stéphane Nicoll
4983a802a7 Polish "Fix Javadoc"
See gh-32403
2024-03-09 16:02:01 +01:00
Maksim Sasnouski
abdccffa39 Fix Javadoc
This commit fixes various Javadoc issues across the code base.

See gh-32403
2024-03-09 16:02:00 +01:00
Juergen Hoeller
861ef88d9f Expose savepoint callbacks on TransactionSynchronization
Closes gh-30509
2024-03-01 16:48:51 +01:00
Sam Brannen
b0d08fe2d4 Spring cleaning: avoid deprecation warnings 2024-02-23 12:38:40 +01:00
Sam Brannen
122372c580 Spring cleaning: update copyright headers 2024-02-23 12:21:22 +01:00
Sam Brannen
c98bebd6d3 Spring cleaning: add missing @⁠Override annotations 2024-02-23 12:20:11 +01:00
Stéphane Nicoll
6383a0d7ca Merge branch '6.1.x' 2024-02-21 15:55:55 +01:00
Stéphane Nicoll
5d6501c75e Revisit stored procedure detection
This commit revisits the improved detection algorithm for stored
procedure as, unfortunately, certain JDBC drivers do not support
the documented pattern for schema and procedure name.

To work around this limitation, this commit applies the escaping of
wildcard characters to the case where multiple procedures have been
found for a given search.

Closes gh-32295
2024-02-21 15:54:34 +01:00
Sam Brannen
d86af57e0f Polishing 2024-02-17 16:00:58 +01:00
Sam Brannen
b6df5a677e Polishing 2024-02-16 11:41:22 +01:00
Stéphane Nicoll
2fc8b13dd5 Add support for MySQL backticks
This commit makes sure that content within backticks are skipped
when parsing a SQL statement using NamedParameterUtils. This harmonizes
the current behavior of ignoring special characters that are wrapped
in backticks.

Closes gh-31944
2024-02-15 14:41:30 +01:00
Stéphane Nicoll
18ea43c905 Allow customizations of embedded database connections
This commit allows EmbeddedDatabaseConfigurer instances to be further
customized if necessary. EmbeddedDatabaseBuilder has a way now to set
a DatabaseConfigurer rather than just a type to provide full control,
or customize an existing supported database type using the new
EmbeddedDatabaseConfigurers#customizeConfigurer callback.

Closes gh-21160
2024-02-15 13:46:49 +01:00
Juergen Hoeller
8ff102115a Let BeanPropertyRowMapper subclasses customize mapped names
Closes gh-32199
2024-02-05 18:24:38 +01:00
Juergen Hoeller
d586513d66 Introduce SqlBinaryValue/SqlCharacterValue as alternative to SqlLobValue
Includes direct byte array support via setBytes in StatementCreatorUtils.

Closes gh-32161
2024-01-31 17:12:05 +01:00
Stéphane Nicoll
ef2cae36ac Polish contribution
See gh-32164
2024-01-31 08:57:11 +01:00
Yanming Zhou
efaf41862c Polish StatementCreatorUtilsTests
See gh-32164
2024-01-31 08:56:59 +01:00
Stéphane Nicoll
ad7c090f4c Use catalog name in SimpleJdbcInsert
This commit harmonizes SimpleJdbcCall and SimpleJdbcInsert to
consistently use a catalog name if one is set. Previously,
SimpleJdbcInsert only used the catalog name to retrieve database
metadata.

Closes gh-32124
2024-01-26 17:58:41 +01:00
Stéphane Nicoll
f5b0d9509d Polish 2024-01-17 18:41:15 +01:00
Juergen Hoeller
4d11307b84 Polishing 2024-01-09 11:55:04 +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
87b35e7d8e Polish 2024-01-06 09:21:16 +01:00
Stéphane Nicoll
534d3229fe Polish 2024-01-05 10:46:00 +01:00
Sam Brannen
c0683cd30b Update copyright headers 2023-12-12 14:51:03 +01:00
Juergen Hoeller
69bc4e2828 Delegation support for JDBC 4.3 ConnectionBuilder and ShardingKeyBuilder
Also moves ShardingKeyProvider to datasource package and declares getSuperShardingKey as default method.

Closes gh-31795
See gh-31506
2023-12-08 23:52:22 +01:00
Mohammed Bekraoui
e4e2224449 Support direct shard database operation routing in Spring JDBC (#31506)
Introduce ShardingKeyDataSourceAdapter to get shard connections.

This commit introduces a DataSource proxy, that changes the behavior of the getConnection method to use the `createConnectionBuilder()` api to acquire direct shard connections. The shard connection is acquired by specifying a `ShardingKey` that is correspondent to the wanted shard.
2023-12-08 23:09:39 +01:00
Giuseppe Milicia
748dd94dab Fix Sybase SimpleJdbcCall named parameter binding 2023-12-08 16:15:51 +01:00
Henning Poettker
b3a3b79b44 Adds MySQLIdentityColumnMaxValueIncrementer
The new `DataFieldMaxValueIncrementer` can be used with identity columns in MySQL 8.0 or later.
2023-12-08 16:12:29 +01:00
Juergen Hoeller
3b4c7a8906 Revise LazyConnectionDataSourceProxy for late connection properties check
Includes special support for a read-only DataSource in addition to the regular target DataSource, avoiding the overhead of switching the Connection's read-only flag at the beginning and end of every transaction.

Closes gh-29931
Closes gh-31785
Closes gh-19688
Closes gh-21415
2023-12-07 23:14:17 +01:00
Sam Brannen
302cdeeee6 Clean up warnings in JdbcTransactionManagerTests 2023-12-06 21:35:02 +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
e2852e7355 Replace assertThat(x.contains(y)).isTrue() with assertThat(x).contains(y)
Search for   : assertThat\((.+)\.contains\((.+)\)\)\.isTrue\(\)
Replace with : assertThat($1).contains($2)

Search for   : assertThat\((.+)\.contains\((.+)\)\)\.isFalse\(\)
Replace with : assertThat($1).doesNotContain($2)

Closes gh-31762
2023-12-06 09:48:49 +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