Class 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).
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static long serialVersionUID  
      private boolean subquery_table
      If this is true, then the table def represents a sub-query table.
      private TableSelectExpression subselect_table
      The TableSelectExpression if this is a subquery table.
      private java.lang.String table_alias
      The alias of the table or null if no alias was defined.
      private java.lang.String table_name
      The name of the table this definition references.
      private java.lang.String unique_key
      The unique key name given to this table definition.
    • Constructor Summary

      Constructors 
      Constructor Description
      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 
      Modifier and Type Method Description
      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
    • Field Detail

      • subquery_table

        private boolean subquery_table
        If this is true, then the table def represents a sub-query table. The 'getSubSelectStatement' and 'getAlias' method can be used to get the table information.

        eg. FROM ( SELECT id, number FROM Part ) AS part_info, ....

      • unique_key

        private java.lang.String unique_key
        The unique key name given to this table definition.
      • table_name

        private java.lang.String table_name
        The name of the table this definition references.
      • table_alias

        private java.lang.String table_alias
        The alias of the table or null if no alias was defined.
      • subselect_table

        private TableSelectExpression subselect_table
        The TableSelectExpression if this is a subquery table.
    • 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.
      • 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