Class TableReference
java.lang.Object
org.apache.sis.internal.sql.feature.TableReference
- Direct Known Subclasses:
Relation
A (catalog, schema, table) name tuple, which can be used as keys in hash map.
- Since:
- 1.0
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringThe catalog, schema and table name of a table.(package private) final StringIgnored by this class; reserved for caller and subclasses usage.final StringThe catalog, schema and table name of a table.final StringThe catalog, schema and table name of a table. -
Constructor Summary
ConstructorsConstructorDescriptionTableReference(String catalog, String schema, String table, String freeText) Creates a new tuple with the given names.TableReference(org.opengis.util.GenericName name, String comments) Creates a new tuple with the components of the given name. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturnstrueif the given object is aTableReferencewith equal table, schema and catalog names.(package private) final org.opengis.util.GenericNameCreates a name for the feature type backed by this table.final inthashCode()Computes a hash code from the catalog, schema and table names.(package private) static TreeTable.NodenewChild(TreeTable.Node parent, String name) Adds a child of the given name to the given parent node.(package private) static String[]splitName(org.opengis.util.GenericName name) Splits the given name in (catalog, schema, table) tuple.toString()Formats a string representation of this object for debugging purpose.(package private) static StringtoString(Object owner, Consumer<TreeTable.Node> appender) Formats a graphical representation of an object for debugging purpose.
-
Field Details
-
catalog
The catalog, schema and table name of a table. The table name is mandatory, but the schema and catalog names may be null or empty. Note that an empty string and null values have different meanings in JDBC metadata:- An empty string means that the table name has no catalog (or schema).
- A null value means that the catalog (or schema) name should be ignored.
-
schema
The catalog, schema and table name of a table. The table name is mandatory, but the schema and catalog names may be null or empty. Note that an empty string and null values have different meanings in JDBC metadata:- An empty string means that the table name has no catalog (or schema).
- A null value means that the catalog (or schema) name should be ignored.
-
table
The catalog, schema and table name of a table. The table name is mandatory, but the schema and catalog names may be null or empty. Note that an empty string and null values have different meanings in JDBC metadata:- An empty string means that the table name has no catalog (or schema).
- A null value means that the catalog (or schema) name should be ignored.
-
freeText
Ignored by this class; reserved for caller and subclasses usage. May be null. If non-null, then it is guaranteed non-empty and without leading or trailing spaces.
-
-
Constructor Details
-
TableReference
Creates a new tuple with the given names. -
TableReference
TableReference(org.opengis.util.GenericName name, String comments) Creates a new tuple with the components of the given name.
-
-
Method Details
-
splitName
Splits the given name in (catalog, schema, table) tuple. Those components are returned in an array of length 3, in reverse order. -
getName
Creates a name for the feature type backed by this table. This method does not cache the value; caller is expected to invoke only once and store the name.- Parameters:
analyzer- the object which is analyzing the database schema for inferring feature types.
-
equals
Returnstrueif the given object is aTableReferencewith equal table, schema and catalog names. All other properties that may be defined in subclasses (column names, action on delete, etc.) are ignored; this method is not for testing if twoRelationare fully equal. The purpose of this method is only to useTableReferenceas keys in aHashSetfor remembering full coordinates of tables that may need to be analyzed later. -
hashCode
public final int hashCode()Computes a hash code from the catalog, schema and table names. Seeequals(Object)for information about the purpose. -
newChild
Adds a child of the given name to the given parent node. This is a convenience method fortoString()implementations.- Parameters:
parent- the node where to add a child.name- the name to assign to the child.- Returns:
- the child added to the parent.
-
toString
Formats a graphical representation of an object for debugging purpose. This representation can be printed to the standard output stream (for example) if the output device uses a monospaced font and supports Unicode. -
toString
Formats a string representation of this object for debugging purpose.
-