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