Package com.mckoi.database.interpret

## Class FromTableDef

- java.lang.Object
- - com.mckoi.database.interpret.FromTableDef

All Implemented Interfaces:
  `java.io.Serializable`, `java.lang.Cloneable`

    public final class FromTableDef
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable

Describes a single table declaration in the from clause of a table expression (SELECT).

Author:
  Tobias Downer
See Also:
  Serialized Form

### Constructor Summary

Constructors
`FromTableDef​(TableSelectExpression select)` A simple sub-query table definition (not aliased).
`FromTableDef​(TableSelectExpression select, java.lang.String table_alias)` A table that is a sub-query and given an aliased name.
`FromTableDef​(java.lang.String table_name)` A simple table definition (not aliased).
`FromTableDef​(java.lang.String table_name, java.lang.String table_alias)` Constructs the table def.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.Object` `clone()` Clones the object (deep clone of immutable members).
`java.lang.String` `getAlias()` Returns the alias for this table (or null if no alias given).
`java.lang.String` `getName()` Returns the name of the table.
`TableSelectExpression` `getTableSelectExpression()` Returns the TableSelectExpression if this is a subquery table.
`java.lang.String` `getUniqueKey()` Returns the unique key.
`boolean` `isSubQueryTable()` Returns true if this item in the FROM clause is a subquery table.
`void` `prepareExpressions​(ExpressionPreparer preparer)` Prepares the expressions in this table def.
`void` `setUniqueKey​(java.lang.String unique_key)` Sets the unique key.

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

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

### Constructor Detail

#### FromTableDef

    public FromTableDef​(java.lang.String table_name,
                        java.lang.String table_alias)

Constructs the table def. The constructs a table that is aliased under a different name.

#### FromTableDef

    public FromTableDef​(java.lang.String table_name)

A simple table definition (not aliased).

#### FromTableDef

    public FromTableDef​(TableSelectExpression select,
                        java.lang.String table_alias)

A table that is a sub-query and given an aliased name.

#### FromTableDef

    public FromTableDef​(TableSelectExpression select)

A simple sub-query table definition (not aliased).

### Method Detail

#### setUniqueKey

    public void setUniqueKey​(java.lang.String unique_key)

Sets the unique key.

#### getName

    public java.lang.String getName()

Returns the name of the table.

#### getAlias

    public java.lang.String getAlias()

Returns the alias for this table (or null if no alias given).

#### getUniqueKey

    public java.lang.String getUniqueKey()

Returns the unique key.

#### isSubQueryTable

    public boolean isSubQueryTable()

Returns true if this item in the FROM clause is a subquery table.

#### getTableSelectExpression

    public TableSelectExpression getTableSelectExpression()

Returns the TableSelectExpression if this is a subquery table.

#### prepareExpressions

    public void prepareExpressions​(ExpressionPreparer preparer)
                            throws DatabaseException

Prepares the expressions in this table def.

Throws:
  `DatabaseException`

#### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

Clones the object (deep clone of immutable members).

Overrides:
  `clone` in class `java.lang.Object`
Throws:
  `java.lang.CloneNotSupportedException`