java.lang.Object
io.helidon.dbclient.DbColumnBase
Base
DbColumn implementation.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDbColumnBase(Object value, MapperManager mapperManager, String... mappingQualifiers) Create a new instance. -
Method Summary
Modifier and TypeMethodDescription<N> Value<N> as(io.helidon.common.GenericType<N> type) <N> Value<N> <N> Value<N> asDouble()asInt()asLong()asString()<T> Tget(io.helidon.common.GenericType<T> type) Value of this column as a generic type.<T> TTyped value of this column.protected <SRC,T> T map(SRC value, io.helidon.common.GenericType<T> type) Map value to target type usingMapper.protected <SRC,T> T Map value to target type usingMapper.protected ObjectrawValue()Get raw value of the database column.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DbColumnBase
Create a new instance.- Parameters:
value- valuemapperManager- mapper managermappingQualifiers- mapping qualifiers
-
-
Method Details
-
rawValue
Get raw value of the database column.- Returns:
- raw value of the column
-
get
Description copied from interface:DbColumnTyped value of this column. This method can return a correct result only if the type is the same asDbColumn.javaType()or there is aMapperregistered that can map it.- Specified by:
getin interfaceDbColumn- Specified by:
getin interfaceValue<Object>- Type Parameters:
T- type of the returned value- Parameters:
type- class of the type that should be returned (must be supported by the underlying data type)- Returns:
- value of this column correctly typed
- Throws:
MapperException- in case the type is not the underlyingDbColumn.javaType()and there is no mapper registered for it
-
get
Description copied from interface:DbColumnValue of this column as a generic type. This method can return a correct result only if the type represents a class, or if there is aMapperregistered that can map underlyingDbColumn.javaType()to the type requested. -
as
- Specified by:
asin interfaceValue<Object>- Throws:
MapperException
-
as
- Specified by:
asin interfaceValue<Object>- Throws:
MapperException
-
as
-
asOptional
- Specified by:
asOptionalin interfaceValue<Object>- Throws:
MapperException
-
asBoolean
-
asString
-
asInt
-
asLong
-
asDouble
-
map
protected <SRC,T> T map(SRC value, io.helidon.common.GenericType<T> type) Map value to target type usingMapper.- Type Parameters:
SRC- type of the source valueT- type of the target value- Parameters:
value- source valuetype- target type- Returns:
- result of the mapping
- Throws:
MapperException- in case the mapper was not found or failed
-
map
Map value to target type usingMapper.String.valueOf(Object)is used as fallback option whenMapperfails.- Type Parameters:
SRC- type of the source valueT- type of the target value- Parameters:
value- source valuetype- target type- Returns:
- result of the mapping
-