Class TableName

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable

    public final class TableName
    extends java.lang.Object
    implements java.lang.Comparable, java.io.Serializable
    A name of a table and any associated referencing information. This object is immutable.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String schema_name
      The name of the schema of the table.
      (package private) static long serialVersionUID  
      private java.lang.String table_name
      The name of the table.
      private static java.lang.String UNKNOWN_SCHEMA_NAME
      The constant 'schema_name' that defines a schema that is unknown.
    • Constructor Summary

      Constructors 
      Constructor Description
      TableName​(java.lang.String table_name)  
      TableName​(java.lang.String schema_name, java.lang.String table_name)
      Constructs the name.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(java.lang.Object ob)
      Comparable.
      boolean equals​(java.lang.Object ob)
      Equality.
      boolean equalsIgnoreCase​(TableName tn)
      Equality but ignore the case.
      java.lang.String getName()
      Returns the table name.
      java.lang.String getSchema()
      Returns the schema name or null if the schema name is unknown.
      int hashCode()
      Hash code.
      static TableName resolve​(java.lang.String namev)
      Resolves a [schema name].[table name] type syntax to a TableName object.
      static TableName resolve​(java.lang.String schemav, java.lang.String namev)
      Resolves a [schema name].[table name] type syntax to a TableName object.
      TableName resolveSchema​(java.lang.String scheman)
      Resolves a schema reference in a table name.
      java.lang.String toString()
      To string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • UNKNOWN_SCHEMA_NAME

        private static final java.lang.String UNKNOWN_SCHEMA_NAME
        The constant 'schema_name' that defines a schema that is unknown.
        See Also:
        Constant Field Values
      • schema_name

        private final java.lang.String schema_name
        The name of the schema of the table. This value can be 'null' which means the schema is currently unknown.
      • table_name

        private final java.lang.String table_name
        The name of the table.
    • Constructor Detail

      • TableName

        public TableName​(java.lang.String schema_name,
                         java.lang.String table_name)
        Constructs the name.
      • TableName

        public TableName​(java.lang.String table_name)
    • Method Detail

      • getSchema

        public java.lang.String getSchema()
        Returns the schema name or null if the schema name is unknown.
      • getName

        public java.lang.String getName()
        Returns the table name.
      • resolveSchema

        public TableName resolveSchema​(java.lang.String scheman)
        Resolves a schema reference in a table name. If the schema in this table is 'null' (which means the schema is unknown) then it is set to the given schema argument.
      • resolve

        public static TableName resolve​(java.lang.String schemav,
                                        java.lang.String namev)
        Resolves a [schema name].[table name] type syntax to a TableName object. Uses 'schemav' only if there is no schema name explicitely specified.
      • resolve

        public static TableName resolve​(java.lang.String namev)
        Resolves a [schema name].[table name] type syntax to a TableName object.
      • toString

        public java.lang.String toString()
        To string.
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object ob)
        Equality.
        Overrides:
        equals in class java.lang.Object
      • equalsIgnoreCase

        public boolean equalsIgnoreCase​(TableName tn)
        Equality but ignore the case.
      • compareTo

        public int compareTo​(java.lang.Object ob)
        Comparable.
        Specified by:
        compareTo in interface java.lang.Comparable
      • hashCode

        public int hashCode()
        Hash code.
        Overrides:
        hashCode in class java.lang.Object