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 ColumnCreates a new aliasedColumn.as(SqlIdentifier alias) Creates a new aliasedColumn.between(Expression begin, Expression end) Creates aBETWEENCondition.static Columnstatic Columncreate(SqlIdentifier name, Table table) booleangetName()getTable()inthashCode()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 NULLcondition.isNull()Creates aIS NULLcondition.like(Expression expression) Creates aLIKECondition.notBetween(Expression begin, Expression end) Creates aNOT BETWEENCondition.notIn(Expression... expression) notLike(Expression expression) Creates aNOT LIKECondition.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
Comparisoncondition.
-
isNotEqualTo
Creates a!=(not equals)Condition.- Parameters:
expression- right side of the comparison.- Returns:
- the
Comparisoncondition.
-
between
Creates aBETWEENCondition.- Parameters:
begin- begin value for the comparison.end- end value for the comparison.- Returns:
- the
Betweencondition. - Since:
- 2.0
-
notBetween
Creates aNOT BETWEENCondition.- Parameters:
begin- begin value for the comparison.end- end value for the comparison.- Returns:
- the
Betweencondition. - Since:
- 2.0
-
isLess
Creates a<(less)Condition.- Parameters:
expression- right side of the comparison.- Returns:
- the
Comparisoncondition.
-
isLessOrEqualTo
CCreates a<=(greater)Condition.- Parameters:
expression- right side of the comparison.- Returns:
- the
Comparisoncondition.
-
isGreater
Creates a!=(not equals)Condition.- Parameters:
expression- right side of the comparison.- Returns:
- the
Comparisoncondition.
-
isGreaterOrEqualTo
Creates a<=(greater or equal to)Condition.- Parameters:
expression- right side of the comparison.- Returns:
- the
Comparisoncondition.
-
like
Creates aLIKECondition.- Parameters:
expression- right side of the comparison.- Returns:
- the
Likecondition.
-
notLike
Creates aNOT LIKECondition.- Parameters:
expression- right side of the comparison.- Returns:
- the
Likecondition. - Since:
- 2.0
-
in
- Parameters:
expression- right side of the comparison.- Returns:
- the
Incondition.
-
in
- Parameters:
subselect- right side of the comparison.- Returns:
- the
Incondition.
-
notIn
- Parameters:
expression- right side of the comparison.- Returns:
- the
Incondition.
-
notIn
- Parameters:
subselect- right side of the comparison.- Returns:
- the
Incondition.
-
isNull
Creates aIS NULLcondition.- Returns:
- the
IsNullcondition.
-
isNotNull
Creates aIS NOT NULLcondition.- Returns:
- the
Conditioncondition.
-
set
Creates a valueassignment.- Parameters:
value- the value to assign.- Returns:
- the
AssignValueassignment.
-
getName
-
getReferenceName
-
getTable
-
toString
Description copied from interface:SegmentReturn 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:SegmentCheck whether thisSegmentis equal to anotherSegment.Equality is typically given if the
Segment.toString()representation matches. -
hashCode
public int hashCode()Description copied from interface:SegmentGenerate a hash code from thisSegment.Hashcode typically derives from the
Segment.toString()representation so twoSegments yield the sameSegment.hashCode()if theirSegment.toString()representation matches. -
visit
Description copied from interface:Visitable
-