Package groovy.sql

# Class SqlOrderByVisitor

java.lang.Object
groovy.sql.SqlOrderByVisitor

public class SqlOrderByVisitor extends Object
Derives an SQL `ORDER BY` fragment from a simple sort closure, used by `DataSet`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SqlOrderByVisitor()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getOrderBy()`
  Returns the SQL `ORDER BY` fragment built so far.
  `void`
  `visit(Statement code)`
  Appends the outermost referenced property name of each property access in the supplied closure body, in source order.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SqlOrderByVisitor

    public SqlOrderByVisitor()

- ## Method Details

  - ### visit

    public void visit(Statement code)
    Appends the outermost referenced property name of each property access in the supplied closure body, in source order.
    Parameters:
      `code` - the sort closure body to inspect

  - ### getOrderBy

    public String getOrderBy()
    Returns the SQL `ORDER BY` fragment built so far.
    Returns:
      the derived order-by fragment