Commit Graph

934 Commits

Author SHA1 Message Date
Juergen Hoeller 6ff75f157b Detect current schema as indicated by JDBC Connection
Closes gh-28723
2023-11-24 23:24:20 +01:00
Stéphane Nicoll 34031ebea9 Escape schema and function name patterns if necessary
The JDBC API that retrieves a proedure or a function allows to specify
patterns for the schema and the procedure name. So far, we've called
this API with the value as is, which does not work if either contains
a wildcard characters that need to be escaped.

This commit updates GenericCallMetadataProvider to escape, if necessary,
the schema or procedure name using the search string escape from the
database metadata.

Closes gh-22725
2023-11-24 15:49:41 +01:00
Juergen Hoeller c60926476a Polishing 2023-11-22 12:23:24 +01:00
Juergen Hoeller 0e6bf098cb Merge branch '6.0.x'
# Conflicts:
#	build.gradle
#	framework-platform/framework-platform.gradle
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java
2023-11-15 13:36:03 +01:00
Juergen Hoeller c373f496f3 Consistent ordering of overloaded operations 2023-11-15 13:29:35 +01:00
Juergen Hoeller 01fc1ee3bb Introduce update variant with KeyHolder and explicit key column names
Closes gh-31607
2023-11-15 12:20:22 +01:00
Juergen Hoeller 2b7a9209b3 Merge branch '6.0.x' 2023-11-14 12:52:25 +01:00
Juergen Hoeller 99327b7db1 Preserve nested square brackets within parameter name
Closes gh-31596
2023-11-14 12:51:19 +01:00
Stéphane Nicoll f5453cc445 Polish 2023-11-10 16:42:43 +01:00
Juergen Hoeller 6c00e6162b Merge branch '6.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java
2023-11-09 11:50:55 +01:00
Juergen Hoeller 9957bb6918 Check for procedure vs function constants in CallMetaDataContext
Closes gh-31550
2023-11-09 10:52:51 +01:00
Sam Brannen 9759bf5964 Merge branch '6.0.x' 2023-11-07 17:13:46 +01:00
Sam Brannen c5bcfc7682 Polish contribution
See gh-31554
2023-11-07 17:08:44 +01:00
Sam Brannen 5752e03d97 Polishing 2023-11-07 16:58:21 +01:00
Stéphane Nicoll c30b3796f2 Merge branch '6.0.x' 2023-11-07 10:37:22 +01:00
Stéphane Nicoll 50e55d5219 Polish "Add SAP HANA duplicate key exception error code"
See gh-31554
2023-11-07 10:33:14 +01:00
Fabrizio De Felice fcd4ba2f1f Add SAP HANA duplicate key exception error code
See gh-31554
2023-11-07 10:27:51 +01:00
Sam Brannen 54839a7126 Test quoted identifiers in schema in SimpleJdbcInsert
This commit introduces additional tests for "quoted identifier" support
in SimpleJdbcInsert when the schema itself is defined using quoted
identifiers -- for example, to use keywords as column names.

See gh-31208
2023-10-24 14:36:10 +02:00
Sam Brannen 71330ddb0f Revise support for quoted identifiers in SimpleJdbcInsert
Closes gh-31208
2023-10-24 11:52:51 +02:00
Sam Brannen a803206d5f Polishing 2023-10-24 11:52:51 +02:00
Sam Brannen 2d792f000a Polish "Apply SingleSpaceSeparator Checkstyle module"
See gh-31469
2023-10-22 14:18:18 +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
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 c0d98fcc7a Consistent Object result declarations for ResultQuerySpec
Closes gh-31403
2023-10-10 22:58:13 +02:00
Juergen Hoeller de6692e7d8 Merge branch '6.0.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMapping.java
2023-10-10 21:58:31 +02:00
Juergen Hoeller 8b5d993e61 Throw IllegalArgumentException for null SQL String
Closes gh-31391
2023-10-10 21:55:12 +02:00
Stéphane Nicoll 61f27dafee Polish "Use schema-based config in sql-error-codes.xml"
See gh-31354
2023-10-04 13:12:56 +02:00
ralph.riedel c52645905a Use schema-based config in sql-error-codes.xml
This commit replaces the reference to the beans DTD in
sql-error-codes.xml with the preferred schema-based configuration
approach.

See gh-31354
2023-10-04 13:10:40 +02:00
Sam Brannen c45bf3c061 Merge branch '6.0.x' 2023-10-02 17:30:29 +02:00
Sam Brannen 147abc91a5 Polish BeanPropertyRowMapper Javadoc 2023-10-02 17:29:26 +02:00
Stéphane Nicoll 699947c496 Merge branch '6.0.x' 2023-10-02 15:09:12 +02:00
Stéphane Nicoll e12eb9436d Fix description of default behavior in BeanPropertyRowMapper
Closes gh-29285
2023-10-02 15:07:09 +02:00
Juergen Hoeller 38a0e17ede Prefer query(Class) method in javadoc example
See gh-26594
2023-09-28 14:33:20 +02:00
Sam Brannen d50ec68ad7 Polish contribution
See gh-31248
2023-09-26 13:49:03 +02:00
Lee Jaeheon 6d2d8a36c2 Introduce initialize() in AbstractRouting[DataSource|ConnectionFactory]
This commit introduces initialize() methods in
AbstractRoutingDataSource and AbstractRoutingConnectionFactory as an
alternative to invoking afterPropertiesSet().

Closes gh-31248
2023-09-26 13:20:11 +02:00
Sam Brannen 64b4a3cf0d Update KeyHolder in JdbcClient when using positional parameters
Prior to this commit, DefaultJdbcClient updated the supplied KeyHolder
when using named parameters but not for positional parameters.

This commit refactors the creation of the
PreparedStatementCreatorFactory so that the PreparedStatementCreator
properly creates a PreparedStatement which returns generated keys.

Closes gh-31297
2023-09-22 17:21:21 +02:00
Sam Brannen 4841e52205 Rename constants in JdbcClientIndexedParameterTests 2023-09-22 16:49:46 +02:00
Stéphane Nicoll c21a9b94c5 Polish "Allow batch update to take a KeyHolder"
See gh-28132
2023-09-15 16:46:21 +02:00
Chirag Tailor 78db5dd516 Allow batch update to take a KeyHolder
See gh-28132
2023-09-15 16:38:17 +02:00
Juergen Hoeller 550f05c9dc Merge branch '6.0.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java
2023-09-13 17:28:54 +02:00
Juergen Hoeller 659500bc1f Polishing 2023-09-13 17:27:32 +02:00
Juergen Hoeller ae8a353041 Reject iterable/collection value for positional parameter
Closes gh-31215
2023-09-13 16:50:01 +02:00
Juergen Hoeller 3099710087 Merge branch '6.0.x'
# Conflicts:
#	spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/R2dbcTransactionManager.java
#	spring-r2dbc/src/test/java/org/springframework/r2dbc/connection/R2dbcTransactionManagerUnitTests.java
2023-09-11 17:40:11 +02:00
Juergen Hoeller db7654225e Polishing 2023-09-11 17:36:57 +02:00
Sam Brannen 6ca01e15cf Polishing 2023-09-10 14:50:47 +02:00
Toshiaki Maki 588b5a45f8 Pass correct SqlParameterSource to NamedParameterJdbcTemplate in DefaultJdbcClient
Prior to this commit, when using RowCallbackHandler or ResultSetExtractor in JdbcClient
and passing a parameter to paramSource(), an exception was thrown stating "No value
supplied for the SQL parameter 'xxxxxx'" because the SqlParameterSource used internally
was the wrong one.

Closes gh-31195
2023-09-10 14:42:54 +02:00
Sam Brannen c9e13575ca Use switch expression and constants in CallMetaDataProviderFactory 2023-09-08 14:05:03 +02:00
Sam Brannen 762d903aad Convert TableMetaData to a record
This simplifies the code and also improves diagnostics while debugging.
2023-09-08 14:04:47 +02:00
Sam Brannen 47d760845b Add missing @Nullable declaration 2023-09-08 14:00:52 +02:00
Sam Brannen ab5d46411a Introduce identifierNameToUse() in GenericCallMetaDataProvider 2023-09-08 13:59:46 +02:00