public class Column extends Object implements Expression, Named
SELECT … FROM
clause.
Renders to: <name>
or <table(alias)>.<name>
.Modifier and Type | Method and Description |
---|---|
static Column |
aliased(String name,
Table table,
String alias)
|
Column |
as(SqlIdentifier alias)
Creates a new aliased
Column . |
Column |
as(String alias)
Creates a new aliased
Column . |
static Column |
create(SqlIdentifier name,
Table table)
|
static Column |
create(String name,
Table table)
|
boolean |
equals(Object obj)
|
Column |
from(Table table)
|
SqlIdentifier |
getName() |
SqlIdentifier |
getReferenceName() |
Table |
getTable() |
int |
hashCode()
Generate a hash code from this
Segment . |
In |
in(Expression... expression)
|
In |
in(Select subselect)
|
Comparison |
isEqualTo(Expression expression)
Creates a
= (equals) Condition . |
Comparison |
isGreater(Expression expression)
Creates a {@code !
|
Comparison |
isGreaterOrEqualTo(Expression expression)
|
Comparison |
isLess(Expression expression)
|
Comparison |
isLessOrEqualTo(Expression expression)
|
Comparison |
isNotEqualTo(Expression expression)
Creates a {@code !
|
Condition |
isNotNull()
Creates a
IS NOT NULL condition. |
IsNull |
isNull()
Creates a
IS NULL condition. |
Like |
like(Expression expression)
Creates a
LIKE Condition . |
In |
notIn(Expression... expression)
|
In |
notIn(Select subselect)
|
AssignValue |
set(Expression value)
Creates a value
assignment . |
String |
toString()
Return a SQL string representation of this
Segment . |
void |
visit(Visitor visitor)
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static Column create(String name, Table table)
name
- column name, must not null or empty.table
- the table, must not be null.Column
.public static Column create(SqlIdentifier name, Table table)
name
- column name, must not null.table
- the table, must not be null.Column
.public static Column aliased(String name, Table table, String alias)
name
- column name, must not null or empty.table
- the table, must not be null.alias
- column alias name, must not null or empty.Column
.public Column as(String alias)
Column
.alias
- column alias name, must not null or empty.Column
.public Column as(SqlIdentifier alias)
Column
.alias
- column alias name, must not null.Column
.public Comparison isEqualTo(Expression expression)
=
(equals) Condition
.expression
- right side of the comparison.Comparison
condition.public Comparison isNotEqualTo(Expression expression)
!=
(not equals) Condition
.expression
- right side of the comparison.Comparison
condition.public Comparison isLess(Expression expression)
expression
- right side of the comparison.Comparison
condition.public Comparison isLessOrEqualTo(Expression expression)
expression
- right side of the comparison.Comparison
condition.public Comparison isGreater(Expression expression)
!=
(not equals) Condition
.expression
- right side of the comparison.Comparison
condition.public Comparison isGreaterOrEqualTo(Expression expression)
expression
- right side of the comparison.Comparison
condition.public Like like(Expression expression)
LIKE
Condition
.expression
- right side of the comparison.Like
condition.public In in(Expression... expression)
expression
- right side of the comparison.In
condition.public In in(Select subselect)
subselect
- right side of the comparison.In
condition.public In notIn(Expression... expression)
expression
- right side of the comparison.In
condition.public In notIn(Select subselect)
subselect
- right side of the comparison.In
condition.public Condition isNotNull()
IS NOT NULL
condition.Condition
condition.public AssignValue set(Expression value)
assignment
.value
- the value to assign.AssignValue
assignment.public SqlIdentifier getName()
public SqlIdentifier getReferenceName()
public String toString()
Segment
Segment
.
The representation is intended for debugging purposes and an approximation to the generated SQL. While it might
work in the context of a specific dialect, you should not that the Segment.toString()
representation works across
multiple databases.public int hashCode()
Segment
Segment
.
Hashcode typically derives from the Segment.toString()
representation so two Segment
s yield the same
Segment.hashCode()
if their Segment.toString()
representation matches.public boolean equals(Object obj)
Segment
Segment
is equal to another Segment
.
Equality is typically given if the Segment.toString()
representation matches.Copyright © 2017–2020 Pivotal Software, Inc.. All rights reserved.