public class TableLocation
extends java.lang.Object
| Constructor and Description |
|---|
TableLocation(java.sql.ResultSet rs) |
TableLocation(java.lang.String table) |
TableLocation(java.lang.String schema,
java.lang.String table) |
TableLocation(java.lang.String catalog,
java.lang.String schema,
java.lang.String table) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
capsIdentifier(java.lang.String identifier,
java.lang.Boolean isH2Database)
Change case of parameters to make it more user-friendly.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getCatalog() |
java.lang.String |
getCatalog(java.lang.String defaultValue) |
java.lang.String |
getSchema() |
java.lang.String |
getSchema(java.lang.String defaultValue) |
java.lang.String |
getTable() |
int |
hashCode() |
static TableLocation |
parse(java.lang.String concatenatedTableLocation)
Convert catalog.schema.table, schema.table or table into a TableLocation
instance.
|
static TableLocation |
parse(java.lang.String concatenatedTableLocation,
java.lang.Boolean isH2Database)
Convert catalog.schema.table, schema.table or table into a TableLocation
instance.
|
static java.lang.String |
quoteIdentifier(java.lang.String identifier)
Always Quote string for both H2 and Postgre compatibility
|
static java.lang.String |
quoteIdentifier(java.lang.String identifier,
boolean isH2DataBase)
Quote identifier only if necessary.
|
void |
setDefaultSchema(java.lang.String defaultSchema) |
java.lang.String |
toString() |
java.lang.String |
toString(boolean isH2)
String representation of Table location, for insertion in SQL statement.
|
public TableLocation(java.sql.ResultSet rs)
throws java.sql.SQLException
rs - result set obtained through DatabaseMetaData.getTables(String, String, String, String[])java.sql.SQLExceptionpublic TableLocation(java.lang.String table)
table - Table name without quotespublic TableLocation(java.lang.String schema,
java.lang.String table)
schema - Schema name without quotestable - Table name without quotespublic TableLocation(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
catalog - Catalog name without quotesschema - Schema name without quotestable - Table name without quotespublic static java.lang.String capsIdentifier(java.lang.String identifier,
java.lang.Boolean isH2Database)
identifier - Table, Catalog, Schema, or column nameisH2Database - True if H2, False if PostGreSQL, null if unknownpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String getCatalog()
public java.lang.String getCatalog(java.lang.String defaultValue)
defaultValue - Return this value if this attribute is not defined.public java.lang.String getSchema()
public java.lang.String getSchema(java.lang.String defaultValue)
defaultValue - Return this value if this attribute is not defined.public java.lang.String getTable()
public int hashCode()
hashCode in class java.lang.Objectpublic static TableLocation parse(java.lang.String concatenatedTableLocation)
concatenatedTableLocation - Table location [[Catalog.]Schema.]Tablepublic static TableLocation parse(java.lang.String concatenatedTableLocation, java.lang.Boolean isH2Database)
concatenatedTableLocation - Table location [[Catalog.]Schema.]TableisH2Database - True if H2, False if PostGreSQL, null if unknownpublic static java.lang.String quoteIdentifier(java.lang.String identifier)
identifier - Catalog,Schema,Table or Field namepublic static java.lang.String quoteIdentifier(java.lang.String identifier,
boolean isH2DataBase)
identifier - Catalog,Schema,Table or Field nameisH2DataBase - True if the quote is for H2, false if for POSTGREpublic void setDefaultSchema(java.lang.String defaultSchema)
defaultSchema - Default connection schema, used for table location equality test.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(boolean isH2)
isH2 - True if H2, false ifCopyright © 2026 gvSIG Association. All rights reserved.