インタフェース ResultSetConverter
-
- 既知の実装クラスのリスト:
DefaultResultSetConverter
public interface ResultSetConverterConvertResultSetfrom database to specified objects.- 作成者:
- nkjm
-
-
メソッドの概要
すべてのメソッド インスタンス・メソッド abstractメソッド 修飾子とタイプ メソッド 説明 ObjectconvertColumnValueTo(SormOptions options, ResultSet resultSet, int column, int columnType, Class<?> toType)booleanisStandardClass(SormOptions options, Class<?> objectClass)Returns the given type could be converted to the native object or not.voidsetLetterCaseOfKeyInMap(String letterCase)Defines the letter case of the keys in the result oftoSingleMap(org.nkjmlab.sorm4j.extension.SormOptions, java.sql.ResultSet, java.util.List<java.lang.String>, java.util.List<java.lang.Integer>).Map<String,Object>toSingleMap(SormOptions options, ResultSet resultSet, List<String> columns, List<Integer> columnTypes)Converts the result from database to a map objects.<T> TtoSingleStandardObject(SormOptions options, ResultSet resultSet, int columnType, Class<T> objectClass)Converts to a single native object of the given object class.
-
-
-
メソッドの詳細
-
convertColumnValueTo
Object convertColumnValueTo(SormOptions options, ResultSet resultSet, int column, int columnType, Class<?> toType) throws SQLException
Reads a column from the current row in the providedResultSetand returns an instance of the specified JavaClasscontaining the values read. This method is mainly used for "SEARCH SQL AND READ TO POJO". i.e. Convert from Sql to Java by the specified class. This method is used while convertingResultSetrows to objects. The class type is the field type in the target bean. null's will be respected for any non-native types. This means that if a field is of type Integer it will be able to receive a null value from the ResultSet; on the other hand, if a field is of type int it will receive 0 for a null value from theResultSet.- パラメータ:
options-resultSet-ResultSet(positioned in the row to be processed)column- column index in the result set (starting with 1)columnType-toType-Classof the object to be returned- 例外:
SQLException
-
isStandardClass
boolean isStandardClass(SormOptions options, Class<?> objectClass)
Returns the given type could be converted to the native object or not.- パラメータ:
options-objectClass-- 戻り値:
-
toSingleMap
Map<String,Object> toSingleMap(SormOptions options, ResultSet resultSet, List<String> columns, List<Integer> columnTypes) throws SQLException
Converts the result from database to a map objects. The data of the column is extracted by corresponding column types.Keys in the results returned in lower case by default. The setting is changed by
setLetterCaseOfKeyInMap(java.lang.String).- パラメータ:
options-resultSet-columns-columnTypes- SQL types fromTypes- 戻り値:
- 例外:
SQLException
-
setLetterCaseOfKeyInMap
void setLetterCaseOfKeyInMap(String letterCase)
Defines the letter case of the keys in the result oftoSingleMap(org.nkjmlab.sorm4j.extension.SormOptions, java.sql.ResultSet, java.util.List<java.lang.String>, java.util.List<java.lang.Integer>).- パラメータ:
letterCase-
-
toSingleStandardObject
<T> T toSingleStandardObject(SormOptions options, ResultSet resultSet, int columnType, Class<T> objectClass) throws SQLException
Converts to a single native object of the given object class.- 型パラメータ:
T-- パラメータ:
options-resultSet-columnType-objectClass-- 戻り値:
- 例外:
SQLException
-
-