All Superinterfaces:
Visitable
All Known Subinterfaces:
Assignment, Condition, Delete, Expression, Insert, Select, TableLike, Update
All Known Implementing Classes:
AliasedExpression, AnalyticFunction, AnalyticFunction.Partition, AndCondition, AssignValue, AsteriskFromTable, Between, BindMarker, BooleanLiteral, Cast, Column, Comparison, ConstantCondition, Expressions.SimpleExpression, FalseCondition, From, In, InlineQuery, Into, IsNull, Join, Like, Literal, MultipleCondition, NestedCondition, Not, NumericLiteral, OrCondition, OrderBy, OrderByField, SegmentList, SelectList, SimpleFunction, SimpleSegment, StringLiteral, Subselect, SubselectExpression, Table, TrueCondition, Values, Where

public interface Segment extends Visitable
Supertype of all Abstract Syntax Tree (AST) segments. Segments are typically immutable and mutator methods return new instances instead of changing the called instance.
Since:
1.1
Author:
Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
    Check whether this Segment is equal to another Segment.
    int
    Generate a hash code from thisSegment.
    Return a SQL string representation of this Segment.

    Methods inherited from interface org.springframework.data.relational.core.sql.Visitable

    visit
  • Method Details

    • equals

      boolean equals(Object other)
      Check whether this Segment is equal to another Segment.

      Equality is typically given if the toString() representation matches.

      Overrides:
      equals in class Object
      Parameters:
      other - the reference object with which to compare.
      Returns:
      true if this object is the same as the other argument; false otherwise.
    • hashCode

      int hashCode()
      Generate a hash code from thisSegment.

      Hashcode typically derives from the toString() representation so two Segments yield the same hashCode() if their toString() representation matches.

      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.
    • toString

      String toString()
      Return a SQL string representation of this Segment.

      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 toString() representation works across multiple databases.

      Overrides:
      toString in class Object
      Returns:
      a SQL string representation of this Segment.