- java.lang.Object
-
- io.helidon.dbclient.mongodb.MongoDbColumn
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tas(GenericType<T> type)Value of this column as a generic type.<T> Tas(Class<T> type)Typed value of this column.StringdbType()Type of the column in the language of the database.Class<?>javaType()Type of the column as would be returned by the underlying database driver.Stringname()Column name.
-
-
-
Method Detail
-
as
public <T> T as(Class<T> type) throws MapperException
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:
asin interfaceDbColumn- 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
-
as
public <T> T as(GenericType<T> type) throws MapperException
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.- Specified by:
asin interfaceDbColumn- Type Parameters:
T- type of the returned value- Parameters:
type- requested type- Returns:
- value mapped to the expected type if possible
- Throws:
MapperException- in case the mapping cannot be done
-
javaType
public Class<?> javaType()
Description copied from interface:DbColumnType of the column as would be returned by the underlying database driver.- Specified by:
javaTypein interfaceDbColumn- Returns:
- class of the type
- See Also:
DbColumn.dbType()
-
dbType
public String dbType()
Description copied from interface:DbColumnType of the column in the language of the database.Example for SQL - if a column is declared as
VARCHAR(256)in the database, this method would returnVARCHARand methodDbColumn.javaType()would returnString.
-
-