Package io.micronaut.data.runtime.mapper
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.
- 
Method SummaryModifier and TypeMethodDescriptiondefault @Nullable BigDecimalreadBigDecimal(@NonNull String name) Read a BigDecimal value for the given name.default booleanreadBoolean(@NonNull String name) Read a boolean value for the given name.default byteRead a byte value for the given name.default byte[]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(@NonNull 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(@NonNull String prefix, @NonNull 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 a 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(@NonNull String name) Read a string value for the given name.default @Nullable DatereadTimestamp(@NonNull String name) Read a timestamp value for the given index.
- 
Method Details- 
getResultSetRS getResultSet()- Returns:
- The current state of the result.
 
- 
getResultReaderResultReader<RS,String> getResultReader()- Returns:
- The result reader.
 
- 
readEntity@NonNull <E> E readEntity(@NonNull @NonNull String prefix, @NonNull @NonNull Class<E> type) throws DataAccessException Read an entity using the given prefix to be passes to result set lookups.- Type Parameters:
- E- The entity generic type
- Parameters:
- prefix- The prefix
- type- The entity type
- Returns:
- The entity result
- Throws:
- DataAccessException- if it is not possible read the result from the result set.
 
- 
readDTO@NonNull <E,D> D readDTO(@NonNull @NonNull String prefix, @NonNull @NonNull Class<E> rootEntity, @NonNull @NonNull Class<D> dtoType) throws DataAccessException Read an entity using the given prefix to be passes to result set lookups.- Type Parameters:
- E- The entity generic type
- D- The DTO generic type
- Parameters:
- prefix- The prefix
- rootEntity- The entity type
- dtoType- The DTO type. Must be annotated with- Introspected
- Returns:
- The entity result
- Throws:
- DataAccessException- if it is not possible read the result from the result set.
 
- 
readLongRead a long value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The long value
 
- 
readCharRead a char value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The char value
 
- 
readDateRead a date value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The char value
 
- 
readTimestampRead a timestamp value for the given index.- Parameters:
- name- The name (such as the column name)
- Returns:
- The char value
 
- 
readStringRead a string value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The string value
 
- 
readIntRead a int value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The int value
 
- 
readBooleanRead a boolean value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The boolean value
 
- 
readFloatRead a float value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The float value
 
- 
readByteRead a byte value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The byte value
 
- 
readShortRead a short value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The short value
 
- 
readDoubleRead a double value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The double value
 
- 
readBigDecimalRead a BigDecimal value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The BigDecimal value
 
- 
readBytesRead a byte[] value for the given name.- Parameters:
- name- The name (such as the column name)
- Returns:
- The byte[] value
 
 
-