Class TableName

java.lang.Object
com.mckoi.database.TableName
All Implemented Interfaces:
Serializable, Comparable

public final class TableName extends Object implements Comparable, Serializable
A name of a table and any associated referencing information. This object is immutable.
Author:
Tobias Downer
See Also:
  • Constructor Details

    • TableName

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

      public TableName(String table_name)
  • Method Details

    • getSchema

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

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

      public TableName resolveSchema(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(String schemav, 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(String namev)
      Resolves a [schema name].[table name] type syntax to a TableName object.
    • toString

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

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

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

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

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