Class Cast
java.lang.Object
org.springframework.data.relational.core.sql.Cast
- All Implemented Interfaces:
Expression
,Segment
,Visitable
Represents a
CAST
expression like CAST(something AS JSON
.- Since:
- 2.3
- Author:
- Jens Schauder
-
Method Summary
Modifier and TypeMethodDescriptionstatic Expression
create
(Expression expression, String targetType) Creates a newCAST
expression.boolean
int
hashCode()
Generate a hash code from thisSegment
.toString()
Return a SQL string representation of thisSegment
.void
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Method Details
-
create
Creates a newCAST
expression.- Parameters:
expression
- the expression to cast. Must not be null.targetType
- the type to cast to. Must not be null.- Returns:
- the
CAST
forexpression
intotargetType
.
-
getTargetType
-
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. -
visit
Description copied from interface:Visitable
-
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. -
equals
Description copied from interface:Segment
Check whether thisSegment
is equal to anotherSegment
.Equality is typically given if the
Segment.toString()
representation matches.
-