Package org.h2.table

# Class CTE

java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.table.Table
org.h2.table.QueryExpressionTable
org.h2.table.CTE

All Implemented Interfaces:
  `HasSQL`

public final class CTE extends QueryExpressionTable
A common table expression.

## Field Summary

### Fields inherited from class org.h2.table.Table

`columns, compareMode, EXCLUSIVE_LOCK, READ_LOCK, TYPE_CACHED, TYPE_MEMORY, WRITE_LOCK`

### Fields inherited from class org.h2.engine.DbObject

`AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER`

### Fields inherited from interface org.h2.util.HasSQL

`ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS`

## Constructor Summary

Constructors
Constructor
Description
`CTE(String name, Query query, String querySQL, ArrayList<Parameter> params, Column[] columnTemplates, SessionLocal session, boolean recursive, QueryScope queryScope)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canDrop()`
Check if this table can be dropped.
`protected QueryExpressionIndex`
`createIndex(SessionLocal session, int[] masks)`
`String`
`getCreateSQL()`
Construct the CREATE ...
`QueryScope`
`getQueryScope()`
Returns the scope of this table
`String`
`getQuerySQL()`
`ResultInterface`
`getRecursiveResult()`
`StringBuilder`
`getSQL(StringBuilder builder, int sqlFlags)`
Appends the SQL statement of this object to the specified builder.
`TableType`
`getTableType()`
Get the table type name
`Query`
`getTopQuery()`
`boolean`
`isDeterministic()`
Check if the table is deterministic.
`boolean`
`isRecursive()`
`void`
`setRecursiveResult(ResultInterface value)`

### Methods inherited from class org.h2.table.QueryExpressionTable

`addDependencies, addIndex, addRow, canGetRowCount, canReference, checkSupportAlter, close, createQueryColumnTemplateList, getBestPlanItem, getIndexes, getMaxDataModificationId, getParameterOffset, getQuery, getRowCount, getRowCountApproximation, getScanIndex, getScanIndex, isInsertable, isQueryComparable, isView, removeRow, truncate`

### Methods inherited from class org.h2.table.Table

`addConstraint, addDependentMaterializedView, addDependentView, addSequence, addSynonym, addTrigger, canTruncate, checkDeadlock, checkWritingAllowed, compareValues, convertInsertRow, convertUpdateRow, createRow, doesColumnExist, dropMultipleColumnsConstraintsAndIndexes, findColumn, findPrimaryKey, fire, fireAfterRow, fireBeforeRow, fireRow, getCheckForeignKeyConstraints, getChildren, getColumn, getColumn, getColumn, getColumns, getCompareMode, getConstraints, getDependentMaterializedViews, getDependentViews, getDiskSpaceUsed, getIdentityColumn, getIndex, getIndexForColumn, getMainIndexColumn, getNullRow, getOnCommitDrop, getOnCommitTruncate, getPrimaryKey, getRow, getRowFactory, getRowIdColumn, getSQLTableType, getTemplateRow, getTemplateSimpleRow, getTriggers, getType, getVisibleColumns, hasSelectTrigger, isGlobalTemporary, isLockedExclusively, isLockedExclusivelyBy, isPersistData, isPersistIndexes, isRowLockable, lock, lockRow, removeChildrenAndResources, removeColumnExpressionsDependencies, removeConstraint, removeDependentMaterializedView, removeDependentView, removeIndex, removeIndexOrTransferOwnership, removeSequence, removeSynonym, removeTrigger, rename, renameColumn, setCheckForeignKeyConstraints, setColumns, setOnCommitDrop, setOnCommitTruncate, unlock, updateRow, updateRows`

### Methods inherited from class org.h2.schema.SchemaObject

`getSchema, getSQL`

### Methods inherited from class org.h2.engine.DbObject

`checkRename, getComment, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toString`

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

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

### Methods inherited from interface org.h2.util.HasSQL

`getTraceSQL`

## Constructor Details

### CTE

public CTE(String name, Query query, String querySQL, ArrayList<Parameter> params, Column[] columnTemplates, SessionLocal session, boolean recursive, QueryScope queryScope)

## Method Details

### createIndex

protected QueryExpressionIndex createIndex(SessionLocal session, int[] masks)

### getTopQuery

public Query getTopQuery()

Specified by:
  `getTopQuery` in class `QueryExpressionTable`

### getCreateSQL

public String getCreateSQL()
Description copied from class: `DbObject`
Construct the CREATE ... SQL statement for this object.

Specified by:
  `getCreateSQL` in class `DbObject`
Returns:
  the SQL statement

### canDrop

public boolean canDrop()
Description copied from class: `Table`
Check if this table can be dropped.

Specified by:
  `canDrop` in class `Table`
Returns:
  true if it can

### getTableType

public TableType getTableType()
Description copied from class: `Table`
Get the table type name

Specified by:
  `getTableType` in class `Table`
Returns:
  the table type name

### getSQL

public StringBuilder getSQL(StringBuilder builder, int sqlFlags)
Description copied from interface: `HasSQL`
Appends the SQL statement of this object to the specified builder.

Specified by:
  `getSQL` in interface `HasSQL`
Overrides:
  `getSQL` in class `SchemaObject`
Parameters:
  `builder` - string builder
  `sqlFlags` - formatting flags
Returns:
  the specified string builder

### getQuerySQL

public String getQuerySQL()

### getQueryScope

public QueryScope getQueryScope()
Description copied from class: `QueryExpressionTable`
Returns the scope of this table

Specified by:
  `getQueryScope` in class `QueryExpressionTable`
Returns:
  the scope of this table

### isRecursive

public boolean isRecursive()

### isDeterministic

public boolean isDeterministic()
Description copied from class: `Table`
Check if the table is deterministic.

Overrides:
  `isDeterministic` in class `QueryExpressionTable`
Returns:
  true if it is

### setRecursiveResult

public void setRecursiveResult(ResultInterface value)

### getRecursiveResult

public ResultInterface getRecursiveResult()