Class InlineQuery
java.lang.Object
org.springframework.data.relational.core.sql.Subselect
org.springframework.data.relational.core.sql.InlineQuery
Represents a inline query within a SQL statement. Typically, used in
FROM or JOIN clauses.
Renders to: (>SELECT<) AS >ALIAS< in a from or join clause, and to >ALIAS< when
used in an expression.
Note that this does not implement Aliased because the Alias is not optional but required and therefore more
like a name although the SQL term is "alias".
- Since:
- 2.3
- Author:
- Jens Schauder
-
Method Summary
Modifier and TypeMethodDescriptionstatic InlineQueryCreates a newInlineQueryusing analias.static InlineQuerycreate(Select select, SqlIdentifier alias) Creates a newInlineQueryusing analias.booleangetName()inthashCode()Generate a hash code from thisSegment.voidMethods inherited from class org.springframework.data.relational.core.sql.Subselect
getSelect, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.data.relational.core.sql.Segment
equals, hashCode, toString
-
Method Details
-
create
Creates a newInlineQueryusing analias.- Parameters:
select- must not be null.alias- must not be null or empty.- Returns:
- the new
InlineQueryusing thealias.
-
create
Creates a newInlineQueryusing analias.- Parameters:
select- must not be null or empty.alias- must not be null or empty.- Returns:
- the new
InlineQueryusing thealias.
-
getName
-
getReferenceName
- Specified by:
getReferenceNamein interfaceTableLike- Returns:
- the table name as it is used in references. This can be the actual
nameor analias.
-
visit
Description copied from interface:Visitable -
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.
-