Class Context

java.lang.Object
io.github.torand.fastersql.sql.Context

public class Context extends Object
Holds the context of statement SQL builders.
  • Method Details

    • of

      public static Context of(Dialect dialect)
      Creates context with specified SQL dialect.
      Parameters:
      dialect - the SQL dialect.
      Returns:
      the context.
    • withCommand

      public Context withCommand(Command command)
      Sets the current statement command.
      Parameters:
      command - the statement command.
      Returns:
      the modified context.
    • withClause

      public Context withClause(Clause clause)
      Sets the current statement clause.
      Parameters:
      clause - the clause.
      Returns:
      the modified context.
    • withOuterStatement

      public Context withOuterStatement(SelectStatement outerStatement)
      Sets the current outer statement.
      Parameters:
      outerStatement - the outer statement.
      Returns:
      the modified context.
    • getDialect

      public Dialect getDialect()
      Gets the SQL dialect.
      Returns:
      the SQL dialect.
    • getCommand

      public Command getCommand()
      Gets the current statement command.
      Returns:
      the statement command.
    • isCommand

      public boolean isCommand(Command command)
      Indicates whether the current statement command is a specific command.
      Parameters:
      command - the command.
      Returns:
      true if the current command matches; false if not.
    • isClause

      public boolean isClause(Clause clause)
      Indicates whether the current statement clause is a specific clause.
      Parameters:
      clause - the clause.
      Returns:
      true if the current clause matches; false if not.
    • getOuterStatements

      public List<SelectStatement> getOuterStatements()
      Gets the current outer statements, if any.
      Returns:
      the outer statements.