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, 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, 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, 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, ValueBigint, ValueBinary, ValueBlob, ValueBoolean, ValueChar, ValueClob, ValueCollectionBase, ValueDate, ValueDecfloat, ValueDouble, ValueEnum, ValueEnumBase, ValueExpression, ValueGeometry, ValueInteger, ValueInterval, ValueJavaObject, ValueJson, ValueLob, ValueNull, ValueNumeric, ValueReal, ValueRow, ValueSmallint, 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
`static int` `ADD_PLAN_INFORMATION` Add execution plan information.
`static int` `DEFAULT_SQL_FLAGS` Default flags.
`static int` `NO_CASTS` Don't add casts around literals.
`static int` `QUOTE_ONLY_WHEN_REQUIRED` Quote identifiers only when it is strictly required (different case or identifier is also a keyword).
`static int` `REPLACE_LOBS_FOR_TRACE` Replace long LOB values with some generated values.
`static int` `TRACE_SQL_FLAGS` Combined flags for trace.

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`default java.lang.String` `getSQL(int sqlFlags)` Get the SQL statement of this expression.
`java.lang.StringBuilder` `getSQL(java.lang.StringBuilder builder, int sqlFlags)` Appends the SQL statement of this object to the specified builder.
`default java.lang.String` `getTraceSQL()` Get a medium size SQL expression for debugging or tracing.

### Field Detail

#### 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:
  Constant Field Values

#### REPLACE_LOBS_FOR_TRACE

    static final int REPLACE_LOBS_FOR_TRACE

Replace long LOB values with some generated values.

See Also:
  Constant Field Values

#### NO_CASTS

    static final int NO_CASTS

Don't add casts around literals.

See Also:
  Constant Field Values

#### ADD_PLAN_INFORMATION

    static final int ADD_PLAN_INFORMATION

Add execution plan information.

See Also:
  Constant Field Values

#### DEFAULT_SQL_FLAGS

    static final int DEFAULT_SQL_FLAGS

Default flags.

See Also:
  Constant Field Values

#### TRACE_SQL_FLAGS

    static final int TRACE_SQL_FLAGS

Combined flags for trace.

See Also:
  Constant Field Values

### Method Detail

#### getTraceSQL

    default java.lang.String getTraceSQL()

Get a medium size SQL expression for debugging or tracing.

Returns:
  the SQL expression

#### getSQL

    default java.lang.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

    java.lang.StringBuilder getSQL(java.lang.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