Module org.mybatis.dynamic.sql
Class AbstractTypeConvertingFunction<T,R,U extends AbstractTypeConvertingFunction<T,R,U>>
- java.lang.Object
-
- org.mybatis.dynamic.sql.select.function.AbstractTypeConvertingFunction<T,R,U>
-
- Type Parameters:
T- The type of the underlying column. For example, if a function converts a VARCHAR to an INT, then the underlying type will be a StringR- The type of the column after the conversion. For example, if a function converts a VARCHAR to an INT, then the converted type will be IntegerU- the specific subtype that implements the function
- All Implemented Interfaces:
BasicColumn,BindableColumn<R>
- Direct Known Subclasses:
AbstractUniTypeFunction
public abstract class AbstractTypeConvertingFunction<T,R,U extends AbstractTypeConvertingFunction<T,R,U>> extends Object implements BindableColumn<R>
Represents a function that can change the underlying type. For example, converting a binary field for a base64 string, or an integer to a string, etc.Thanks to @endink for the idea.
- Author:
- Jeff Butler
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringaliasprotected BindableColumn<T>column
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTypeConvertingFunction(BindableColumn<T> column)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Optional<String>alias()Returns the columns alias if one has been specified.Uas(String alias)Override the base method definition to make it more specific to this interface.protected abstract Ucopy()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mybatis.dynamic.sql.BasicColumn
renderWithTableAlias, renderWithTableAndColumnAlias
-
Methods inherited from interface org.mybatis.dynamic.sql.BindableColumn
convertParameterType, javaType, jdbcType, renderingStrategy, typeHandler
-
-
-
-
Field Detail
-
column
protected final BindableColumn<T> column
-
alias
protected String alias
-
-
Constructor Detail
-
AbstractTypeConvertingFunction
protected AbstractTypeConvertingFunction(BindableColumn<T> column)
-
-
Method Detail
-
alias
public Optional<String> alias()
Description copied from interface:BasicColumnReturns the columns alias if one has been specified.- Specified by:
aliasin interfaceBasicColumn- Returns:
- the column alias
-
as
public U as(String alias)
Description copied from interface:BindableColumnOverride the base method definition to make it more specific to this interface.- Specified by:
asin interfaceBasicColumn- Specified by:
asin interfaceBindableColumn<T>- Parameters:
alias- the column alias to set- Returns:
- new instance with alias set
-
copy
protected abstract U copy()
-
-