Top Description Fields Methods
org.h2.util

public Interface HasSQL

Known Direct Implementers
org.h2.value.ExtTypeInfo, org.h2.value.Value, org.h2.command.dml.MergeUsing.When, org.h2.command.dml.SetClauseList, org.h2.command.query.ForUpdate, org.h2.engine.DbObject, org.h2.engine.NullsDistinct, org.h2.expression.Expression, org.h2.expression.function.table.TableFunction, org.h2.table.Column

An object that has an SQL representation.

Field Summary

Modifier and TypeField and Description
public static final int
ADD_PLAN_INFORMATION

Add execution plan information.

public static final int
DEFAULT_SQL_FLAGS

Default flags.

public static final int
NO_CASTS

Don't add casts around literals.

public static final int
QUOTE_ONLY_WHEN_REQUIRED

Quote identifiers only when it is strictly required (different case or identifier is also a keyword).

public static final int
REPLACE_LOBS_FOR_TRACE

Replace long LOB values with some generated values.

public static final int
TRACE_SQL_FLAGS

Combined flags for trace.

Method Summary

Modifier and TypeMethod and Description
public default String

Returns:

the SQL statement
getSQL
(int
formatting flags
sqlFlags
)

Get the SQL statement of this expression.

public StringBuilder

Returns:

the specified string builder
getSQL
(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Appends the SQL statement of this object to the specified builder.

public default String

Returns:

the SQL expression
getTraceSQL
()

Get a medium size SQL expression for debugging or tracing.

Field Detail

ADD_PLAN_INFORMATIONback to summary
public static final int ADD_PLAN_INFORMATION

Add execution plan information.

DEFAULT_SQL_FLAGSback to summary
public static final int DEFAULT_SQL_FLAGS

Default flags.

NO_CASTSback to summary
public static final int NO_CASTS

Don't add casts around literals.

QUOTE_ONLY_WHEN_REQUIREDback to summary
public static final int QUOTE_ONLY_WHEN_REQUIRED

Quote identifiers only when it is strictly required (different case or identifier is also a keyword).

REPLACE_LOBS_FOR_TRACEback to summary
public static final int REPLACE_LOBS_FOR_TRACE

Replace long LOB values with some generated values.

TRACE_SQL_FLAGSback to summary
public static final int TRACE_SQL_FLAGS

Combined flags for trace.

Method Detail

getSQLback to summary
public 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:int

formatting flags

Returns:String

the SQL statement

getSQLback to summary
public StringBuilder getSQL(StringBuilder builder, int sqlFlags)

Appends the SQL statement of this object to the specified builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

getTraceSQLback to summary
public default String getTraceSQL()

Get a medium size SQL expression for debugging or tracing.

Returns:String

the SQL expression