Class Column
java.lang.Object
org.springframework.data.relational.core.sql.Column
- All Implemented Interfaces:
Expression
,Named
,Segment
,Visitable
Column name within a
SELECT … FROM
clause.
Renders to: <name>
or <table(alias)>.<name>
.
- Since:
- 1.1
- Author:
- Mark Paluch, Jens Schauder
-
Method Summary
Modifier and TypeMethodDescriptionstatic Column
Creates a new aliasedColumn
.as
(SqlIdentifier alias) Creates a new aliasedColumn
.between
(Expression begin, Expression end) Creates aBETWEEN
Condition
.static Column
static Column
create
(SqlIdentifier name, Table table) boolean
getName()
getTable()
int
hashCode()
Generate a hash code from thisSegment
.in
(Expression... expression) isEqualTo
(Expression expression) Creates a=
(equals)Condition
.isGreater
(Expression expression) Creates a!=
(not equals)Condition
.isGreaterOrEqualTo
(Expression expression) Creates a<=
(greater or equal to)Condition
.isLess
(Expression expression) Creates a<
(less)Condition
.isLessOrEqualTo
(Expression expression) CCreates a<=
(greater)Condition
.isNotEqualTo
(Expression expression) Creates a!=
(not equals)Condition
.Creates aIS NOT NULL
condition.isNull()
Creates aIS NULL
condition.like
(Expression expression) Creates aLIKE
Condition
.notBetween
(Expression begin, Expression end) Creates aNOT BETWEEN
Condition
.notIn
(Expression... expression) notLike
(Expression expression) Creates aNOT LIKE
Condition
.set
(Expression value) Creates a valueassignment
.toString()
Return a SQL string representation of thisSegment
.void
-
Method Details
-
create
- Parameters:
name
- column name, must not null or empty.table
- the table, must not be null.- Returns:
- the new
Column
. - Since:
- 2.3
-
create
- Parameters:
name
- column name, must not null.table
- the table, must not be null.- Returns:
- the new
Column
. - Since:
- 2.0
-
aliased
- Parameters:
name
- column name, must not null or empty.table
- the table, must not be null.alias
- column alias name, must not null or empty.- Returns:
- the new
Column
.
-
as
Creates a new aliasedColumn
.- Parameters:
alias
- column alias name, must not null or empty.- Returns:
- the aliased
Column
.
-
as
Creates a new aliasedColumn
.- Parameters:
alias
- column alias name, must not null.- Returns:
- the aliased
Column
. - Since:
- 2.0
-
from
-
isEqualTo
Creates a=
(equals)Condition
.- Parameters:
expression
- right side of the comparison.- Returns:
- the
Comparison
condition.
-
isNotEqualTo
Creates a!=
(not equals)Condition
.- Parameters:
expression
- right side of the comparison.- Returns:
- the
Comparison
condition.
-
between
Creates aBETWEEN
Condition
.- Parameters:
begin
- begin value for the comparison.end
- end value for the comparison.- Returns:
- the
Between
condition. - Since:
- 2.0
-
notBetween
Creates aNOT BETWEEN
Condition
.- Parameters:
begin
- begin value for the comparison.end
- end value for the comparison.- Returns:
- the
Between
condition. - Since:
- 2.0
-
isLess
Creates a<
(less)Condition
.- Parameters:
expression
- right side of the comparison.- Returns:
- the
Comparison
condition.
-
isLessOrEqualTo
CCreates a<=
(greater)Condition
.- Parameters:
expression
- right side of the comparison.- Returns:
- the
Comparison
condition.
-
isGreater
Creates a!=
(not equals)Condition
.- Parameters:
expression
- right side of the comparison.- Returns:
- the
Comparison
condition.
-
isGreaterOrEqualTo
Creates a<=
(greater or equal to)Condition
.- Parameters:
expression
- right side of the comparison.- Returns:
- the
Comparison
condition.
-
like
Creates aLIKE
Condition
.- Parameters:
expression
- right side of the comparison.- Returns:
- the
Like
condition.
-
notLike
Creates aNOT LIKE
Condition
.- Parameters:
expression
- right side of the comparison.- Returns:
- the
Like
condition. - Since:
- 2.0
-
in
- Parameters:
expression
- right side of the comparison.- Returns:
- the
In
condition.
-
in
- Parameters:
subselect
- right side of the comparison.- Returns:
- the
In
condition.
-
notIn
- Parameters:
expression
- right side of the comparison.- Returns:
- the
In
condition.
-
notIn
- Parameters:
subselect
- right side of the comparison.- Returns:
- the
In
condition.
-
isNull
Creates aIS NULL
condition.- Returns:
- the
IsNull
condition.
-
isNotNull
Creates aIS NOT NULL
condition.- Returns:
- the
Condition
condition.
-
set
Creates a valueassignment
.- Parameters:
value
- the value to assign.- Returns:
- the
AssignValue
assignment.
-
getName
-
getReferenceName
-
getTable
-
toString
Description copied from interface:Segment
Return a SQL string representation of thisSegment
.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 assume that the
Segment.toString()
representation works across multiple databases. -
equals
Description copied from interface:Segment
Check whether thisSegment
is equal to anotherSegment
.Equality is typically given if the
Segment.toString()
representation matches. -
hashCode
public int hashCode()Description copied from interface:Segment
Generate a hash code from thisSegment
.Hashcode typically derives from the
Segment.toString()
representation so twoSegment
s yield the sameSegment.hashCode()
if theirSegment.toString()
representation matches. -
visit
Description copied from interface:Visitable
-