Package org.h2.util

Interface HasSQL

All Known Implementing Classes:
AbstractAggregate, Aggregate, Alias, ArrayConstructorByQuery, ArrayElementReference, ArrayFunction, ArrayTableFunction, BetweenPredicate, BinaryOperation, BitFunction, BooleanTest, CardinalityExpression, CastSpecification, CoalesceFunction, Column, Comment, CompareLike, Comparison, CompatibilityDatePlusTimeOperation, CompatibilitySequenceValueFunction, CompressFunction, ConcatenationOperation, ConcatFunction, Condition, ConditionAndOr, ConditionAndOrN, ConditionIn, ConditionInConstantSet, ConditionInParameter, ConditionInQuery, ConditionLocalAndGlobal, ConditionNot, Constant, Constraint, ConstraintCheck, ConstraintDomain, ConstraintReferential, ConstraintUnique, CryptFunction, CSVReadFunction, CSVWriteFunction, CurrentDateTimeValueFunction, CurrentGeneralValueSpecification, DataAnalysisOperation, DataChangeDeltaTable, DataTypeSQLFunction, DateTimeFormatFunction, DateTimeFunction, DayMonthNameFunction, DbObject, DBObjectFunction, DefaultRow, Domain, DomainValueExpression, DualIndex, DualTable, ExistsPredicate, Expression, ExpressionColumn, ExpressionList, ExtTypeInfo, ExtTypeInfoEnum, ExtTypeInfoGeometry, ExtTypeInfoNumeric, ExtTypeInfoRow, FieldReference, FileFunction, Format, Function0_1, Function1, Function1_2, Function2, FunctionAlias, FunctionN, FunctionsDB2Derby, FunctionsLegacy, FunctionsMSSQLServer, FunctionsMySQL, FunctionsOracle, FunctionsPostgreSQL, FunctionTable, HashFunction, Index, InformationSchema, InformationSchemaTable, InformationSchemaTableLegacy, IntervalOperation, IsJsonPredicate, JavaAggregate, JavaFunction, JavaTableFunction, JsonConstructorFunction, LengthFunction, LinkedIndex, LinkSchemaFunction, MathFunction, MathFunction1, MathFunction2, MergeUsing.When, MergeUsing.WhenMatchedThenDelete, MergeUsing.WhenMatchedThenUpdate, MergeUsing.WhenNotMatched, MetaIndex, MetaSchema, MetaTable, ModeFunction, MVDelegateIndex, MVIndex, MVPrimaryIndex, MVSecondaryIndex, MVSpatialIndex, MVTable, NullIfFunction, NullPredicate, OnDuplicateKeyValues, Operation0, Operation1, Operation1_2, Operation2, OperationN, Parameter, PgCatalogSchema, PgCatalogTable, PredicateWithSubquery, RandFunction, RangeIndex, RangeTable, Regclass, RegexpFunction, Right, RightOwner, Role, Row, Rownum, Schema, SchemaObject, SearchedCase, SearchRow, Sequence, SequenceValue, SessionControlFunction, SetClauseList, SetFunction, Setting, SignalFunction, SimpleCase, SimplePredicate, SimpleRowValue, SoundexFunction, Sparse, SpatialKey, StringFunction, StringFunction1, StringFunction2, Subquery, SubstringFunction, SysInfoFunction, Table, TableBase, TableFunction, TableInfoFunction, TableLink, TableSynonym, TableValueConstructorTable, TableView, TimeZoneOperation, ToCharFunction, TriggerObject, TrimFunction, TruncateValueFunction, TypedValueExpression, TypeInfo, TypePredicate, UnaryOperation, UniquePredicate, User, UserAggregate, UserDefinedFunction, Value, ValueArray, ValueBigDecimalBase, ValueBigint, ValueBinary, ValueBlob, ValueBoolean, ValueBytesBase, ValueChar, ValueClob, ValueCollectionBase, ValueDate, ValueDecfloat, ValueDouble, ValueEnum, ValueEnumBase, ValueExpression, ValueGeometry, ValueInteger, ValueInterval, ValueJavaObject, ValueJson, ValueLob, ValueNull, ValueNumeric, ValueReal, ValueRow, ValueSmallint, ValueStringBase, ValueTime, ValueTimestamp, ValueTimestampTimeZone, ValueTimeTimeZone, ValueTinyint, ValueUuid, ValueVarbinary, ValueVarchar, ValueVarcharIgnoreCase, Variable, ViewIndex, VirtualConstructedTable, VirtualConstructedTableIndex, VirtualTable, VirtualTableIndex, Wildcard, WindowFunction, XMLFunction

public interface HasSQL
An object that has an SQL representation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Add execution plan information.
    static final int
    Default flags.
    static final int
    Don't add casts around literals.
    static final int
    Quote identifiers only when it is strictly required (different case or identifier is also a keyword).
    static final int
    Replace long LOB values with some generated values.
    static final int
    Combined flags for trace.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    getSQL(int sqlFlags)
    Get the SQL statement of this expression.
    getSQL(StringBuilder builder, int sqlFlags)
    Appends the SQL statement of this object to the specified builder.
    default String
    Get a medium size SQL expression for debugging or tracing.
  • Field Details

    • QUOTE_ONLY_WHEN_REQUIRED

      static final int QUOTE_ONLY_WHEN_REQUIRED
      Quote identifiers only when it is strictly required (different case or identifier is also a keyword).
      See Also:
    • REPLACE_LOBS_FOR_TRACE

      static final int REPLACE_LOBS_FOR_TRACE
      Replace long LOB values with some generated values.
      See Also:
    • NO_CASTS

      static final int NO_CASTS
      Don't add casts around literals.
      See Also:
    • ADD_PLAN_INFORMATION

      static final int ADD_PLAN_INFORMATION
      Add execution plan information.
      See Also:
    • DEFAULT_SQL_FLAGS

      static final int DEFAULT_SQL_FLAGS
      Default flags.
      See Also:
    • TRACE_SQL_FLAGS

      static final int TRACE_SQL_FLAGS
      Combined flags for trace.
      See Also:
  • Method Details

    • getTraceSQL

      default String getTraceSQL()
      Get a medium size SQL expression for debugging or tracing.
      Returns:
      the SQL expression
    • getSQL

      default String getSQL(int sqlFlags)
      Get the SQL statement of this expression. This may not always be the original SQL statement, specially after optimization.
      Parameters:
      sqlFlags - formatting flags
      Returns:
      the SQL statement
    • getSQL

      StringBuilder getSQL(StringBuilder builder, int sqlFlags)
      Appends the SQL statement of this object to the specified builder.
      Parameters:
      builder - string builder
      sqlFlags - formatting flags
      Returns:
      the specified string builder