Class QualifiedName

java.lang.Object
org.apache.ignite.table.QualifiedName
All Implemented Interfaces:
Serializable

public final class QualifiedName extends Object implements Serializable
Class represents a catalog object name (table, index and etc.) and provides factory methods.

Qualified name is a pair of schema name and object name.

Factory methods expects that given names (both: schema name and object name) respect SQL syntax rules for identifiers.

  • Identifier must start from any character in the Unicode General Category classes “Lu”, “Ll”, “Lt”, “Lm”, “Lo”, or “Nl”.
  • Identifier character (expect the first one) may be U+00B7 (middle dot), or any character in the Unicode General Category classes “Mn”, “Mc”, “Nd”, “Pc”, or “Cf”.
  • Identifier that contains any other characters must be quoted with double-quotes.
  • Double-quote inside the identifier must be encoded as 2 consequent double-quote chars.

parse(String) method also accepts a qualified name in canonical form: [<schema_name>.]<object_name>. Schema name is optional, when not set, then DEFAULT_SCHEMA_NAME will be used.

The object contains normalized names, which are case sensitive. That means, an unquoted name will be cast to upper case; for quoted names - the unnecessary quotes will be removed preserving escaped double-quote symbols. E.g. "tbl0" - is equivalent to "TBL0", "\"Tbl0\"" - "Tbl0", etc.

See Also:
  • Field Details

  • Method Details

    • parse

      public static QualifiedName parse(String simpleOrCanonicalName)
      Factory method that creates qualified name object by parsing given simple or canonical object name.
      Parameters:
      simpleOrCanonicalName - Object simple name or qualified name in canonical form.
      Returns:
      Qualified name.
    • fromSimple

      public static QualifiedName fromSimple(String simpleName)
      Factory method that creates qualified name from given simple name by resolving it against the default schema.
      Parameters:
      simpleName - Object name.
      Returns:
      Qualified name.
    • of

      public static QualifiedName of(@Nullable @Nullable String schemaName, String objectName)
      Factory method that creates qualified name from given schema and object name.
      Parameters:
      schemaName - Schema name or null for default schema.
      objectName - Object name.
      Returns:
      Qualified name.
    • schemaName

      public String schemaName()
      Returns normalized schema name.
    • objectName

      public String objectName()
      Returns normalized object name.
    • toCanonicalForm

      public String toCanonicalForm()
      Returns qualified name in canonical form.
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object