Polishing
This commit is contained in:
parent
61f89a1f04
commit
c0c4298048
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2022 the original author or authors.
|
* Copyright 2002-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -180,7 +180,7 @@ public class PreparedStatementCreatorFactory {
|
||||||
*/
|
*/
|
||||||
public PreparedStatementCreator newPreparedStatementCreator(String sqlToUse, @Nullable Object[] params) {
|
public PreparedStatementCreator newPreparedStatementCreator(String sqlToUse, @Nullable Object[] params) {
|
||||||
return new PreparedStatementCreatorImpl(
|
return new PreparedStatementCreatorImpl(
|
||||||
sqlToUse, params != null ? Arrays.asList(params) : Collections.emptyList());
|
sqlToUse, (params != null ? Arrays.asList(params) : Collections.emptyList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -211,9 +211,8 @@ public class SqlUpdateTests {
|
||||||
given(resultSet.getObject(1)).willReturn(11);
|
given(resultSet.getObject(1)).willReturn(11);
|
||||||
given(preparedStatement.executeUpdate()).willReturn(1);
|
given(preparedStatement.executeUpdate()).willReturn(1);
|
||||||
given(preparedStatement.getGeneratedKeys()).willReturn(resultSet);
|
given(preparedStatement.getGeneratedKeys()).willReturn(resultSet);
|
||||||
given(connection.prepareStatement(INSERT_GENERATE_KEYS,
|
given(connection.prepareStatement(INSERT_GENERATE_KEYS, PreparedStatement.RETURN_GENERATED_KEYS))
|
||||||
PreparedStatement.RETURN_GENERATED_KEYS)
|
.willReturn(preparedStatement);
|
||||||
).willReturn(preparedStatement);
|
|
||||||
|
|
||||||
GeneratedKeysUpdater pc = new GeneratedKeysUpdater();
|
GeneratedKeysUpdater pc = new GeneratedKeysUpdater();
|
||||||
KeyHolder generatedKeyHolder = new GeneratedKeyHolder();
|
KeyHolder generatedKeyHolder = new GeneratedKeyHolder();
|
||||||
|
@ -294,6 +293,7 @@ public class SqlUpdateTests {
|
||||||
pc::run);
|
pc::run);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class Updater extends SqlUpdate {
|
private class Updater extends SqlUpdate {
|
||||||
|
|
||||||
public Updater() {
|
public Updater() {
|
||||||
|
|
Loading…
Reference in New Issue