Class SchemaQualifiedName

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

    public final class SchemaQualifiedName
    extends java.lang.Object
    implements java.lang.Comparable<SchemaQualifiedName>, java.io.Serializable
    Schema qualified table name representation.
    Author:
    pzajac
    See Also:
    Serialized Form
    • Constructor Detail

      • SchemaQualifiedName

        public SchemaQualifiedName​(java.lang.String schema,
                                   java.lang.String table)
      • SchemaQualifiedName

        public SchemaQualifiedName​(DBTableInfo ti)
    • Method Detail

      • getSchema

        public java.lang.String getSchema()
      • getTable

        public java.lang.String getTable()
      • valueOf

        public static SchemaQualifiedName valueOf​(java.lang.String schemaQualifiedName)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        schema qualified name in form of schema.tableName
      • equals

        public boolean equals​(java.lang.String fkSchemaName,
                              java.lang.String fkTableName)
      • addSchemaToTableIfMissing

        public static java.lang.String addSchemaToTableIfMissing​(java.lang.String schema,
                                                                 java.lang.String tableName)
      • splitSchemaFromTable

        public static java.lang.String[] splitSchemaFromTable​(java.lang.String schemaPlusTable)
        Splits the schema name from the table name. For a schema qualified table ("FOO.BAR") returns FOO as first element and BAR as second. For a name without a schema prefix ("BAR") returns null as the first element and BAR as second.
        Parameters:
        schemaPlusTable - The name to split.
        Returns:
        First element is schema, second is table
      • schemaPlusTable

        public static java.lang.String schemaPlusTable​(java.lang.String schema,
                                                       java.lang.String table)
      • getEscapedSQN

        public java.lang.String getEscapedSQN​(java.lang.String quoteString)
        Parameters:
        quoteString - a single-char quoteString
        Returns:
        a string representation of SQN, escaped with provided quoteString