Polishing

This commit is contained in:
Juergen Hoeller
2015-11-02 14:42:46 +01:00
parent 6685c78cea
commit cca037a74d
8 changed files with 90 additions and 74 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,6 @@ public class SqlParameter {
/** Used for types that are user-named like: STRUCT, DISTINCT, JAVA_OBJECT, named array types */
private String typeName;
/** The scale to apply in case of a NUMERIC or DECIMAL type, if any */
private Integer scale;
@@ -126,7 +125,7 @@ public class SqlParameter {
/**
* Return the name of the parameter.
* Return the name of the parameter, or {@code null} if anonymous.
*/
public String getName() {
return this.name;

View File

@@ -105,8 +105,7 @@ public class SimpleJdbcCallTests {
adder.declareParameters(
new SqlParameter("amount", Types.INTEGER),
new SqlParameter("custid", Types.INTEGER),
new SqlOutParameter("newid",
Types.INTEGER));
new SqlOutParameter("newid", Types.INTEGER));
Number newId = adder.executeObject(Number.class, new MapSqlParameterSource().
addValue("amount", 1103).
addValue("custid", 3));
@@ -122,8 +121,7 @@ public class SimpleJdbcCallTests {
adder.declareParameters(
new SqlParameter("amount", Types.INTEGER),
new SqlParameter("custid", Types.INTEGER),
new SqlOutParameter("newid",
Types.INTEGER));
new SqlOutParameter("newid", Types.INTEGER));
Number newId = adder.executeObject(Number.class, 1103, 3);
assertEquals(4, newId.intValue());
verifyAddInvoiceWithoutMetaData(false);
@@ -230,12 +228,12 @@ public class SimpleJdbcCallTests {
verifyStatement(adder, "{call ADD_INVOICE(AMOUNT => ?, CUSTID => ?, NEWID => ?)}");
}
private void verifyStatement(SimpleJdbcCall adder, String expected) {
Assert.assertEquals("Incorrect call statement", expected, adder.getCallString());
}
private void initializeAddInvoiceWithoutMetaData(boolean isFunction)
throws SQLException {
private void initializeAddInvoiceWithoutMetaData(boolean isFunction) throws SQLException {
given(databaseMetaData.getDatabaseProductName()).willReturn("MyDB");
given(databaseMetaData.getUserName()).willReturn("me");
given(databaseMetaData.storesLowerCaseIdentifiers()).willReturn(true);
@@ -313,4 +311,5 @@ public class SimpleJdbcCallTests {
verify(proceduresResultSet).close();
verify(procedureColumnsResultSet).close();
}
}