public class SqlColumn<T> extends Object implements BindableColumn<T>, SortSpecification
Modifier and Type | Class and Description |
---|---|
static class |
SqlColumn.Builder |
Modifier and Type | Field and Description |
---|---|
protected String |
alias |
protected boolean |
isDescending |
protected JDBCType |
jdbcType |
protected String |
name |
protected SqlTable |
table |
protected String |
typeHandler |
Modifier | Constructor and Description |
---|---|
protected |
SqlColumn(SqlColumn<?> sqlColumn) |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
alias()
Returns the columns alias if one has been specified.
|
String |
aliasOrName()
Return the column alias or column name.
|
SqlColumn<T> |
as(String alias)
Override the base method definition to make it more specific to this interface.
|
SortSpecification |
descending()
Returns a new instance of the SortSpecification that should render as descending in an
ORDER BY clause.
|
boolean |
isDescending()
Return true if the sort order is descending.
|
Optional<JDBCType> |
jdbcType() |
String |
name() |
static <T> SqlColumn<T> |
of(String name,
SqlTable table) |
static <T> SqlColumn<T> |
of(String name,
SqlTable table,
JDBCType jdbcType) |
String |
renderWithTableAlias(TableAliasCalculator tableAliasCalculator)
Returns the name of the item aliased with a table name if appropriate.
|
Optional<String> |
typeHandler() |
static SqlColumn.Builder |
withName(String name) |
<S> SqlColumn<S> |
withTypeHandler(String typeHandler) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
renderWithTableAndColumnAlias
protected String name
protected SqlTable table
protected JDBCType jdbcType
protected boolean isDescending
protected String alias
protected String typeHandler
protected SqlColumn(SqlColumn<?> sqlColumn)
public String name()
public Optional<JDBCType> jdbcType()
jdbcType
in interface BindableColumn<T>
public Optional<String> alias()
BasicColumn
alias
in interface BasicColumn
public Optional<String> typeHandler()
typeHandler
in interface BindableColumn<T>
public SortSpecification descending()
SortSpecification
descending
in interface SortSpecification
public SqlColumn<T> as(String alias)
BindableColumn
as
in interface BasicColumn
as
in interface BindableColumn<T>
alias
- the column alias to setpublic boolean isDescending()
SortSpecification
isDescending
in interface SortSpecification
public String aliasOrName()
SortSpecification
aliasOrName
in interface SortSpecification
public String renderWithTableAlias(TableAliasCalculator tableAliasCalculator)
BasicColumn
renderWithTableAlias
in interface BasicColumn
tableAliasCalculator
- the table alias calculator for the current rendererpublic static SqlColumn.Builder withName(String name)
Copyright © 2016–2018 MyBatis.org. All rights reserved.