Package com.mckoi.database
Class TableName
- java.lang.Object
-
- com.mckoi.database.TableName
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable
public final class TableName extends java.lang.Object implements java.lang.Comparable, java.io.SerializableA 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.Stringschema_nameThe name of the schema of the table.(package private) static longserialVersionUIDprivate java.lang.Stringtable_nameThe name of the table.private static java.lang.StringUNKNOWN_SCHEMA_NAMEThe constant 'schema_name' that defines a schema that is unknown.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object ob)Comparable.booleanequals(java.lang.Object ob)Equality.booleanequalsIgnoreCase(TableName tn)Equality but ignore the case.java.lang.StringgetName()Returns the table name.java.lang.StringgetSchema()Returns the schema name or null if the schema name is unknown.inthashCode()Hash code.static TableNameresolve(java.lang.String namev)Resolves a [schema name].[table name] type syntax to a TableName object.static TableNameresolve(java.lang.String schemav, java.lang.String namev)Resolves a [schema name].[table name] type syntax to a TableName object.TableNameresolveSchema(java.lang.String scheman)Resolves a schema reference in a table name.java.lang.StringtoString()To string.
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
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.
-
-
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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object ob)
Equality.- Overrides:
equalsin classjava.lang.Object
-
equalsIgnoreCase
public boolean equalsIgnoreCase(TableName tn)
Equality but ignore the case.
-
compareTo
public int compareTo(java.lang.Object ob)
Comparable.- Specified by:
compareToin interfacejava.lang.Comparable
-
hashCode
public int hashCode()
Hash code.- Overrides:
hashCodein classjava.lang.Object
-
-