Class InfixOperation
java.lang.Object
org.springframework.data.relational.core.sql.InfixOperation
- All Implemented Interfaces:
Expression, Segment, Visitable
Represents an infix (two expressions combined with an operator) operation between two
Expressions such as
arithmetic operations a + b or concatenation a || b.
Results in a rendered expression: <left> <operator> <right> (e.g. col + 4). For conditional
expressions use Comparison instead of a raw InfixOperation.
- Since:
- 4.1.1
- Author:
- Jens Schauder, Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreates a newInfixOperationaliased toalias.as(SqlIdentifier alias) Creates a newInfixOperationaliased toalias.static InfixOperationcreate(Expression left, String operator, Expression right) Create a newInfixOperationusingExpressions and an operator.booleangetLeft()getRight()inthashCode()Generate a hash code from thisSegment.toString()Return a SQL string representation of thisSegment.void
-
Method Details
-
create
Create a newInfixOperationusingExpressions and an operator.- Parameters:
left- the leftExpression.operator- the operator.right- the rightExpression.- Returns:
- the
InfixOperationoperation.
-
getLeft
-
getOperator
-
getRight
-
as
Creates a newInfixOperationaliased toalias.- Parameters:
alias- must not be null or empty.- Returns:
- the new
InfixOperationusing thealias. - Since:
- 4.1.1
-
as
Creates a newInfixOperationaliased toalias.- Parameters:
alias- must not be null or empty.- Returns:
- the new
InfixOperationusing thealias. - Since:
- 4.1.1
-
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. -
visit
-
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. -
equals
Description copied from interface:SegmentCheck whether thisSegmentis equal to anotherSegment.Equality is typically given if the
Segment.toString()representation matches.
-