Ensure configuration methods in SimpleJdbcInsert support method chaining

Prior to this commit, the withoutTableColumnMetaDataAccess() and
includeSynonymsForTableColumnMetaData() methods in SimpleJdbcInsert
incorrectly declared a SimpleJdbcInsertOperations return type, which
prevented method chaining when the instance was declared to be of type
SimpleJdbcInsert.

This commit changes the return types of those methods to
SimpleJdbcInsert to benefit from covariant return types like the rest
of the configuration methods in SimpleJdbcInsert.

Closes gh-31177
This commit is contained in:
Sam Brannen
2023-09-06 11:27:30 +02:00
parent 0a7166234d
commit 734d113b11
2 changed files with 24 additions and 2 deletions

View File

@@ -109,13 +109,13 @@ public class SimpleJdbcInsert extends AbstractJdbcInsert implements SimpleJdbcIn
}
@Override
public SimpleJdbcInsertOperations withoutTableColumnMetaDataAccess() {
public SimpleJdbcInsert withoutTableColumnMetaDataAccess() {
setAccessTableColumnMetaData(false);
return this;
}
@Override
public SimpleJdbcInsertOperations includeSynonymsForTableColumnMetaData() {
public SimpleJdbcInsert includeSynonymsForTableColumnMetaData() {
setOverrideIncludeSynonymsDefault(true);
return this;
}