Interface ResultConsumer.Context<RS>
- Type Parameters:
RS- The result set type.
- Enclosing interface:
ResultConsumer<T,RS>
public static interface ResultConsumer.Context<RS>
A context object that simplifies mapping results to objects.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable BigDecimalreadBigDecimal(String name) Read a BigDecimal value for the given name.default booleanreadBoolean(String name) Read a boolean value for the given name.default byteRead a byte value for the given name.default byte @Nullable []Read a byte[] value for the given name.default charRead a char value for the given name.default @Nullable DateRead a date value for the given name.default doublereadDouble(String name) Read a double value for the given name.<E,D> D Read an entity using the given prefix to be passes to result set lookups.<E> EreadEntity(String prefix, Class<E> type) Read an entity using the given prefix to be passes to result set lookups.default floatRead a float value for the given name.default intRead an int value for the given name.default longRead a long value for the given name.default shortRead a short value for the given name.default @Nullable StringreadString(String name) Read a string value for the given name.default @Nullable DatereadTimestamp(String name) Read a timestamp value for the given index.
-
Method Details
-
getResultSet
RS getResultSet()- Returns:
- The current state of the result.
-
getResultReader
ResultReader<RS,String> getResultReader()- Returns:
- The result reader.
-
readEntity
Read an entity using the given prefix to be passes to result set lookups.- Type Parameters:
E- The entity generic type- Parameters:
prefix- The prefixtype- The entity type- Returns:
- The entity result
- Throws:
DataAccessException- if it is not possible read the result from the result set.
-
readDTO
Read an entity using the given prefix to be passes to result set lookups.- Type Parameters:
E- The entity generic typeD- The DTO generic type- Parameters:
prefix- The prefixrootEntity- The entity typedtoType- The DTO type. Must be annotated withIntrospected- Returns:
- The entity result
- Throws:
DataAccessException- if it is not possible read the result from the result set.
-
readLong
Read a long value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The long value
-
readChar
Read a char value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The char value
-
readDate
-
readTimestamp
-
readString
-
readInt
Read an int value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The int value
-
readBoolean
Read a boolean value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The boolean value
-
readFloat
Read a float value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The float value
-
readByte
Read a byte value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The byte value
-
readShort
Read a short value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The short value
-
readDouble
Read a double value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The double value
-
readBigDecimal
Read a BigDecimal value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The BigDecimal value
-
readBytes
Read a byte[] value for the given name.- Parameters:
name- The name (such as the column name)- Returns:
- The byte[] value
-