Package com.gengoai.sql
Class ResultSetMappers
- java.lang.Object
-
- com.gengoai.sql.ResultSetMappers
-
public final class ResultSetMappers extends Object
Set of commonly used
ResultSetMapper
-
-
Field Summary
Fields Modifier and Type Field Description static ResultSetMapper<Map<String,Object>>
MAP_RESULT_SET_MAPPER
AResultSetMapper
that will return a Map where the key is the column name and the value is the result of callinggetObject
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ResultSetMapper<T>
beanMapper(@NonNull Class<T> tClass)
Creates aResultSetMapper
that will return objects of the given type using aBeanMap
.
-
-
-
Field Detail
-
MAP_RESULT_SET_MAPPER
public static final ResultSetMapper<Map<String,Object>> MAP_RESULT_SET_MAPPER
AResultSetMapper
that will return a Map where the key is the column name and the value is the result of callinggetObject
.
-
-
Method Detail
-
beanMapper
public static <T> ResultSetMapper<T> beanMapper(@NonNull @NonNull Class<T> tClass)
Creates aResultSetMapper
that will return objects of the given type using aBeanMap
. Objects must have a no-argument constructor and the column names must align with the object's properties.- Type Parameters:
T
- the type parameter- Parameters:
tClass
- the class of the object to create- Returns:
- the ResultSetMapper
-
-