- java.lang.Object
-
- io.helidon.dbclient.mongodb.MongoDbColumn
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
as(GenericType<T> type)
Value of this column as a generic type.<T> T
as(Class<T> type)
Typed value of this column.String
dbType()
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.String
name()
Column name.
-
-
-
Method Detail
-
as
public <T> T as(Class<T> type) throws MapperException
Description copied from interface:DbColumn
Typed value of this column. This method can return a correct result only if the type is the same asDbColumn.javaType()
or there is aMapper
registered that can map it.- Specified by:
as
in 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:DbColumn
Value 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 aMapper
registered that can map underlyingDbColumn.javaType()
to the type requested.- Specified by:
as
in 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:DbColumn
Type of the column as would be returned by the underlying database driver.- Specified by:
javaType
in interfaceDbColumn
- Returns:
- class of the type
- See Also:
DbColumn.dbType()
-
dbType
public String dbType()
Description copied from interface:DbColumn
Type 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 returnVARCHAR
and methodDbColumn.javaType()
would returnString
.
-
-