提交 b86b0797 编写于 作者: J Juergen Hoeller

Mark SqlRowSet accessor methods as nullable (for alignment with JDBC)

Closes gh-24042
上级 2a631474
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2019 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.
...@@ -29,6 +29,7 @@ import java.util.HashMap; ...@@ -29,6 +29,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.springframework.jdbc.InvalidResultSetAccessException; import org.springframework.jdbc.InvalidResultSetAccessException;
import org.springframework.lang.Nullable;
/** /**
* The default implementation of Spring's {@link SqlRowSet} interface, wrapping a * The default implementation of Spring's {@link SqlRowSet} interface, wrapping a
...@@ -160,6 +161,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -160,6 +161,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getBigDecimal(int) * @see java.sql.ResultSet#getBigDecimal(int)
*/ */
@Override @Override
@Nullable
public BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException { public BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getBigDecimal(columnIndex); return this.resultSet.getBigDecimal(columnIndex);
...@@ -173,6 +175,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -173,6 +175,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getBigDecimal(String) * @see java.sql.ResultSet#getBigDecimal(String)
*/ */
@Override @Override
@Nullable
public BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException { public BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException {
return getBigDecimal(findColumn(columnLabel)); return getBigDecimal(findColumn(columnLabel));
} }
...@@ -223,6 +226,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -223,6 +226,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getDate(int) * @see java.sql.ResultSet#getDate(int)
*/ */
@Override @Override
@Nullable
public Date getDate(int columnIndex) throws InvalidResultSetAccessException { public Date getDate(int columnIndex) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getDate(columnIndex); return this.resultSet.getDate(columnIndex);
...@@ -236,6 +240,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -236,6 +240,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getDate(String) * @see java.sql.ResultSet#getDate(String)
*/ */
@Override @Override
@Nullable
public Date getDate(String columnLabel) throws InvalidResultSetAccessException { public Date getDate(String columnLabel) throws InvalidResultSetAccessException {
return getDate(findColumn(columnLabel)); return getDate(findColumn(columnLabel));
} }
...@@ -244,6 +249,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -244,6 +249,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getDate(int, Calendar) * @see java.sql.ResultSet#getDate(int, Calendar)
*/ */
@Override @Override
@Nullable
public Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException { public Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getDate(columnIndex, cal); return this.resultSet.getDate(columnIndex, cal);
...@@ -257,6 +263,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -257,6 +263,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getDate(String, Calendar) * @see java.sql.ResultSet#getDate(String, Calendar)
*/ */
@Override @Override
@Nullable
public Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException { public Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
return getDate(findColumn(columnLabel), cal); return getDate(findColumn(columnLabel), cal);
} }
...@@ -349,6 +356,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -349,6 +356,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getNString(int) * @see java.sql.ResultSet#getNString(int)
*/ */
@Override @Override
@Nullable
public String getNString(int columnIndex) throws InvalidResultSetAccessException { public String getNString(int columnIndex) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getNString(columnIndex); return this.resultSet.getNString(columnIndex);
...@@ -362,6 +370,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -362,6 +370,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getNString(String) * @see java.sql.ResultSet#getNString(String)
*/ */
@Override @Override
@Nullable
public String getNString(String columnLabel) throws InvalidResultSetAccessException { public String getNString(String columnLabel) throws InvalidResultSetAccessException {
return getNString(findColumn(columnLabel)); return getNString(findColumn(columnLabel));
} }
...@@ -370,6 +379,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -370,6 +379,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getObject(int) * @see java.sql.ResultSet#getObject(int)
*/ */
@Override @Override
@Nullable
public Object getObject(int columnIndex) throws InvalidResultSetAccessException { public Object getObject(int columnIndex) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getObject(columnIndex); return this.resultSet.getObject(columnIndex);
...@@ -383,6 +393,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -383,6 +393,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getObject(String) * @see java.sql.ResultSet#getObject(String)
*/ */
@Override @Override
@Nullable
public Object getObject(String columnLabel) throws InvalidResultSetAccessException { public Object getObject(String columnLabel) throws InvalidResultSetAccessException {
return getObject(findColumn(columnLabel)); return getObject(findColumn(columnLabel));
} }
...@@ -391,6 +402,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -391,6 +402,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getObject(int, Map) * @see java.sql.ResultSet#getObject(int, Map)
*/ */
@Override @Override
@Nullable
public Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException { public Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getObject(columnIndex, map); return this.resultSet.getObject(columnIndex, map);
...@@ -404,6 +416,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -404,6 +416,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getObject(String, Map) * @see java.sql.ResultSet#getObject(String, Map)
*/ */
@Override @Override
@Nullable
public Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessException { public Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessException {
return getObject(findColumn(columnLabel), map); return getObject(findColumn(columnLabel), map);
} }
...@@ -412,6 +425,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -412,6 +425,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getObject(int, Class) * @see java.sql.ResultSet#getObject(int, Class)
*/ */
@Override @Override
@Nullable
public <T> T getObject(int columnIndex, Class<T> type) throws InvalidResultSetAccessException { public <T> T getObject(int columnIndex, Class<T> type) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getObject(columnIndex, type); return this.resultSet.getObject(columnIndex, type);
...@@ -425,6 +439,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -425,6 +439,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getObject(String, Class) * @see java.sql.ResultSet#getObject(String, Class)
*/ */
@Override @Override
@Nullable
public <T> T getObject(String columnLabel, Class<T> type) throws InvalidResultSetAccessException { public <T> T getObject(String columnLabel, Class<T> type) throws InvalidResultSetAccessException {
return getObject(findColumn(columnLabel), type); return getObject(findColumn(columnLabel), type);
} }
...@@ -454,6 +469,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -454,6 +469,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getString(int) * @see java.sql.ResultSet#getString(int)
*/ */
@Override @Override
@Nullable
public String getString(int columnIndex) throws InvalidResultSetAccessException { public String getString(int columnIndex) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getString(columnIndex); return this.resultSet.getString(columnIndex);
...@@ -467,6 +483,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -467,6 +483,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getString(String) * @see java.sql.ResultSet#getString(String)
*/ */
@Override @Override
@Nullable
public String getString(String columnLabel) throws InvalidResultSetAccessException { public String getString(String columnLabel) throws InvalidResultSetAccessException {
return getString(findColumn(columnLabel)); return getString(findColumn(columnLabel));
} }
...@@ -475,6 +492,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -475,6 +492,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getTime(int) * @see java.sql.ResultSet#getTime(int)
*/ */
@Override @Override
@Nullable
public Time getTime(int columnIndex) throws InvalidResultSetAccessException { public Time getTime(int columnIndex) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getTime(columnIndex); return this.resultSet.getTime(columnIndex);
...@@ -488,6 +506,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -488,6 +506,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getTime(String) * @see java.sql.ResultSet#getTime(String)
*/ */
@Override @Override
@Nullable
public Time getTime(String columnLabel) throws InvalidResultSetAccessException { public Time getTime(String columnLabel) throws InvalidResultSetAccessException {
return getTime(findColumn(columnLabel)); return getTime(findColumn(columnLabel));
} }
...@@ -496,6 +515,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -496,6 +515,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getTime(int, Calendar) * @see java.sql.ResultSet#getTime(int, Calendar)
*/ */
@Override @Override
@Nullable
public Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException { public Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getTime(columnIndex, cal); return this.resultSet.getTime(columnIndex, cal);
...@@ -509,6 +529,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -509,6 +529,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getTime(String, Calendar) * @see java.sql.ResultSet#getTime(String, Calendar)
*/ */
@Override @Override
@Nullable
public Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException { public Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
return getTime(findColumn(columnLabel), cal); return getTime(findColumn(columnLabel), cal);
} }
...@@ -517,6 +538,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -517,6 +538,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getTimestamp(int) * @see java.sql.ResultSet#getTimestamp(int)
*/ */
@Override @Override
@Nullable
public Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException { public Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getTimestamp(columnIndex); return this.resultSet.getTimestamp(columnIndex);
...@@ -530,6 +552,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -530,6 +552,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getTimestamp(String) * @see java.sql.ResultSet#getTimestamp(String)
*/ */
@Override @Override
@Nullable
public Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException { public Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException {
return getTimestamp(findColumn(columnLabel)); return getTimestamp(findColumn(columnLabel));
} }
...@@ -538,6 +561,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -538,6 +561,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getTimestamp(int, Calendar) * @see java.sql.ResultSet#getTimestamp(int, Calendar)
*/ */
@Override @Override
@Nullable
public Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException { public Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException {
try { try {
return this.resultSet.getTimestamp(columnIndex, cal); return this.resultSet.getTimestamp(columnIndex, cal);
...@@ -551,6 +575,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet { ...@@ -551,6 +575,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
* @see java.sql.ResultSet#getTimestamp(String, Calendar) * @see java.sql.ResultSet#getTimestamp(String, Calendar)
*/ */
@Override @Override
@Nullable
public Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException { public Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException {
return getTimestamp(findColumn(columnLabel), cal); return getTimestamp(findColumn(columnLabel), cal);
} }
......
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2019 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.
...@@ -25,6 +25,7 @@ import java.util.Calendar; ...@@ -25,6 +25,7 @@ import java.util.Calendar;
import java.util.Map; import java.util.Map;
import org.springframework.jdbc.InvalidResultSetAccessException; import org.springframework.jdbc.InvalidResultSetAccessException;
import org.springframework.lang.Nullable;
/** /**
* Mirror interface for {@link javax.sql.RowSet}, representing a disconnected variant of * Mirror interface for {@link javax.sql.RowSet}, representing a disconnected variant of
...@@ -74,6 +75,7 @@ public interface SqlRowSet extends Serializable { ...@@ -74,6 +75,7 @@ public interface SqlRowSet extends Serializable {
* @return an BigDecimal object representing the column value * @return an BigDecimal object representing the column value
* @see java.sql.ResultSet#getBigDecimal(int) * @see java.sql.ResultSet#getBigDecimal(int)
*/ */
@Nullable
BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException; BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException;
/** /**
...@@ -82,6 +84,7 @@ public interface SqlRowSet extends Serializable { ...@@ -82,6 +84,7 @@ public interface SqlRowSet extends Serializable {
* @return an BigDecimal object representing the column value * @return an BigDecimal object representing the column value
* @see java.sql.ResultSet#getBigDecimal(String) * @see java.sql.ResultSet#getBigDecimal(String)
*/ */
@Nullable
BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException; BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException;
/** /**
...@@ -122,6 +125,7 @@ public interface SqlRowSet extends Serializable { ...@@ -122,6 +125,7 @@ public interface SqlRowSet extends Serializable {
* @return a Date object representing the column value * @return a Date object representing the column value
* @see java.sql.ResultSet#getDate(int) * @see java.sql.ResultSet#getDate(int)
*/ */
@Nullable
Date getDate(int columnIndex) throws InvalidResultSetAccessException; Date getDate(int columnIndex) throws InvalidResultSetAccessException;
/** /**
...@@ -130,6 +134,7 @@ public interface SqlRowSet extends Serializable { ...@@ -130,6 +134,7 @@ public interface SqlRowSet extends Serializable {
* @return a Date object representing the column value * @return a Date object representing the column value
* @see java.sql.ResultSet#getDate(String) * @see java.sql.ResultSet#getDate(String)
*/ */
@Nullable
Date getDate(String columnLabel) throws InvalidResultSetAccessException; Date getDate(String columnLabel) throws InvalidResultSetAccessException;
/** /**
...@@ -139,6 +144,7 @@ public interface SqlRowSet extends Serializable { ...@@ -139,6 +144,7 @@ public interface SqlRowSet extends Serializable {
* @return a Date object representing the column value * @return a Date object representing the column value
* @see java.sql.ResultSet#getDate(int, Calendar) * @see java.sql.ResultSet#getDate(int, Calendar)
*/ */
@Nullable
Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException; Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException;
/** /**
...@@ -148,6 +154,7 @@ public interface SqlRowSet extends Serializable { ...@@ -148,6 +154,7 @@ public interface SqlRowSet extends Serializable {
* @return a Date object representing the column value * @return a Date object representing the column value
* @see java.sql.ResultSet#getDate(String, Calendar) * @see java.sql.ResultSet#getDate(String, Calendar)
*/ */
@Nullable
Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException; Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException;
/** /**
...@@ -219,9 +226,10 @@ public interface SqlRowSet extends Serializable { ...@@ -219,9 +226,10 @@ public interface SqlRowSet extends Serializable {
* (for NCHAR, NVARCHAR, LONGNVARCHAR columns). * (for NCHAR, NVARCHAR, LONGNVARCHAR columns).
* @param columnIndex the column index * @param columnIndex the column index
* @return a String representing the column value * @return a String representing the column value
* @see java.sql.ResultSet#getNString(int)
* @since 4.1.3 * @since 4.1.3
* @see java.sql.ResultSet#getNString(int)
*/ */
@Nullable
String getNString(int columnIndex) throws InvalidResultSetAccessException; String getNString(int columnIndex) throws InvalidResultSetAccessException;
/** /**
...@@ -229,9 +237,10 @@ public interface SqlRowSet extends Serializable { ...@@ -229,9 +237,10 @@ public interface SqlRowSet extends Serializable {
* (for NCHAR, NVARCHAR, LONGNVARCHAR columns). * (for NCHAR, NVARCHAR, LONGNVARCHAR columns).
* @param columnLabel the column label * @param columnLabel the column label
* @return a String representing the column value * @return a String representing the column value
* @see java.sql.ResultSet#getNString(String)
* @since 4.1.3 * @since 4.1.3
* @see java.sql.ResultSet#getNString(String)
*/ */
@Nullable
String getNString(String columnLabel) throws InvalidResultSetAccessException; String getNString(String columnLabel) throws InvalidResultSetAccessException;
/** /**
...@@ -240,6 +249,7 @@ public interface SqlRowSet extends Serializable { ...@@ -240,6 +249,7 @@ public interface SqlRowSet extends Serializable {
* @return a Object representing the column value * @return a Object representing the column value
* @see java.sql.ResultSet#getObject(int) * @see java.sql.ResultSet#getObject(int)
*/ */
@Nullable
Object getObject(int columnIndex) throws InvalidResultSetAccessException; Object getObject(int columnIndex) throws InvalidResultSetAccessException;
/** /**
...@@ -248,6 +258,7 @@ public interface SqlRowSet extends Serializable { ...@@ -248,6 +258,7 @@ public interface SqlRowSet extends Serializable {
* @return a Object representing the column value * @return a Object representing the column value
* @see java.sql.ResultSet#getObject(String) * @see java.sql.ResultSet#getObject(String)
*/ */
@Nullable
Object getObject(String columnLabel) throws InvalidResultSetAccessException; Object getObject(String columnLabel) throws InvalidResultSetAccessException;
/** /**
...@@ -257,6 +268,7 @@ public interface SqlRowSet extends Serializable { ...@@ -257,6 +268,7 @@ public interface SqlRowSet extends Serializable {
* @return a Object representing the column value * @return a Object representing the column value
* @see java.sql.ResultSet#getObject(int, Map) * @see java.sql.ResultSet#getObject(int, Map)
*/ */
@Nullable
Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException; Object getObject(int columnIndex, Map<String, Class<?>> map) throws InvalidResultSetAccessException;
/** /**
...@@ -266,6 +278,7 @@ public interface SqlRowSet extends Serializable { ...@@ -266,6 +278,7 @@ public interface SqlRowSet extends Serializable {
* @return a Object representing the column value * @return a Object representing the column value
* @see java.sql.ResultSet#getObject(String, Map) * @see java.sql.ResultSet#getObject(String, Map)
*/ */
@Nullable
Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessException; Object getObject(String columnLabel, Map<String, Class<?>> map) throws InvalidResultSetAccessException;
/** /**
...@@ -273,9 +286,10 @@ public interface SqlRowSet extends Serializable { ...@@ -273,9 +286,10 @@ public interface SqlRowSet extends Serializable {
* @param columnIndex the column index * @param columnIndex the column index
* @param type the Java type to convert the designated column to * @param type the Java type to convert the designated column to
* @return a Object representing the column value * @return a Object representing the column value
* @see java.sql.ResultSet#getObject(int)
* @since 4.1.3 * @since 4.1.3
* @see java.sql.ResultSet#getObject(int, Class)
*/ */
@Nullable
<T> T getObject(int columnIndex, Class<T> type) throws InvalidResultSetAccessException; <T> T getObject(int columnIndex, Class<T> type) throws InvalidResultSetAccessException;
/** /**
...@@ -283,9 +297,10 @@ public interface SqlRowSet extends Serializable { ...@@ -283,9 +297,10 @@ public interface SqlRowSet extends Serializable {
* @param columnLabel the column label * @param columnLabel the column label
* @param type the Java type to convert the designated column to * @param type the Java type to convert the designated column to
* @return a Object representing the column value * @return a Object representing the column value
* @see java.sql.ResultSet#getObject(int)
* @since 4.1.3 * @since 4.1.3
* @see java.sql.ResultSet#getObject(String, Class)
*/ */
@Nullable
<T> T getObject(String columnLabel, Class<T> type) throws InvalidResultSetAccessException; <T> T getObject(String columnLabel, Class<T> type) throws InvalidResultSetAccessException;
/** /**
...@@ -310,6 +325,7 @@ public interface SqlRowSet extends Serializable { ...@@ -310,6 +325,7 @@ public interface SqlRowSet extends Serializable {
* @return a String representing the column value * @return a String representing the column value
* @see java.sql.ResultSet#getString(int) * @see java.sql.ResultSet#getString(int)
*/ */
@Nullable
String getString(int columnIndex) throws InvalidResultSetAccessException; String getString(int columnIndex) throws InvalidResultSetAccessException;
/** /**
...@@ -318,6 +334,7 @@ public interface SqlRowSet extends Serializable { ...@@ -318,6 +334,7 @@ public interface SqlRowSet extends Serializable {
* @return a String representing the column value * @return a String representing the column value
* @see java.sql.ResultSet#getString(String) * @see java.sql.ResultSet#getString(String)
*/ */
@Nullable
String getString(String columnLabel) throws InvalidResultSetAccessException; String getString(String columnLabel) throws InvalidResultSetAccessException;
/** /**
...@@ -326,6 +343,7 @@ public interface SqlRowSet extends Serializable { ...@@ -326,6 +343,7 @@ public interface SqlRowSet extends Serializable {
* @return a Time object representing the column value * @return a Time object representing the column value
* @see java.sql.ResultSet#getTime(int) * @see java.sql.ResultSet#getTime(int)
*/ */
@Nullable
Time getTime(int columnIndex) throws InvalidResultSetAccessException; Time getTime(int columnIndex) throws InvalidResultSetAccessException;
/** /**
...@@ -334,6 +352,7 @@ public interface SqlRowSet extends Serializable { ...@@ -334,6 +352,7 @@ public interface SqlRowSet extends Serializable {
* @return a Time object representing the column value * @return a Time object representing the column value
* @see java.sql.ResultSet#getTime(String) * @see java.sql.ResultSet#getTime(String)
*/ */
@Nullable
Time getTime(String columnLabel) throws InvalidResultSetAccessException; Time getTime(String columnLabel) throws InvalidResultSetAccessException;
/** /**
...@@ -343,6 +362,7 @@ public interface SqlRowSet extends Serializable { ...@@ -343,6 +362,7 @@ public interface SqlRowSet extends Serializable {
* @return a Time object representing the column value * @return a Time object representing the column value
* @see java.sql.ResultSet#getTime(int, Calendar) * @see java.sql.ResultSet#getTime(int, Calendar)
*/ */
@Nullable
Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException; Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException;
/** /**
...@@ -352,6 +372,7 @@ public interface SqlRowSet extends Serializable { ...@@ -352,6 +372,7 @@ public interface SqlRowSet extends Serializable {
* @return a Time object representing the column value * @return a Time object representing the column value
* @see java.sql.ResultSet#getTime(String, Calendar) * @see java.sql.ResultSet#getTime(String, Calendar)
*/ */
@Nullable
Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException; Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException;
/** /**
...@@ -360,6 +381,7 @@ public interface SqlRowSet extends Serializable { ...@@ -360,6 +381,7 @@ public interface SqlRowSet extends Serializable {
* @return a Timestamp object representing the column value * @return a Timestamp object representing the column value
* @see java.sql.ResultSet#getTimestamp(int) * @see java.sql.ResultSet#getTimestamp(int)
*/ */
@Nullable
Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException; Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException;
/** /**
...@@ -368,6 +390,7 @@ public interface SqlRowSet extends Serializable { ...@@ -368,6 +390,7 @@ public interface SqlRowSet extends Serializable {
* @return a Timestamp object representing the column value * @return a Timestamp object representing the column value
* @see java.sql.ResultSet#getTimestamp(String) * @see java.sql.ResultSet#getTimestamp(String)
*/ */
@Nullable
Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException; Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException;
/** /**
...@@ -377,6 +400,7 @@ public interface SqlRowSet extends Serializable { ...@@ -377,6 +400,7 @@ public interface SqlRowSet extends Serializable {
* @return a Timestamp object representing the column value * @return a Timestamp object representing the column value
* @see java.sql.ResultSet#getTimestamp(int, Calendar) * @see java.sql.ResultSet#getTimestamp(int, Calendar)
*/ */
@Nullable
Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException; Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException;
/** /**
...@@ -386,6 +410,7 @@ public interface SqlRowSet extends Serializable { ...@@ -386,6 +410,7 @@ public interface SqlRowSet extends Serializable {
* @return a Timestamp object representing the column value * @return a Timestamp object representing the column value
* @see java.sql.ResultSet#getTimestamp(String, Calendar) * @see java.sql.ResultSet#getTimestamp(String, Calendar)
*/ */
@Nullable
Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException; Timestamp getTimestamp(String columnLabel, Calendar cal) throws InvalidResultSetAccessException;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册