org.d2rq.db.vendor
Class PostgreSQL

java.lang.Object
  extended by org.d2rq.db.vendor.SQL92
      extended by org.d2rq.db.vendor.PostgreSQL
All Implemented Interfaces:
Vendor

public class PostgreSQL
extends SQL92


Nested Class Summary
 
Nested classes/interfaces inherited from class org.d2rq.db.vendor.SQL92
SQL92.IdentifierParser, SQL92.PatternDoublingQuoter, SQL92.Quoter
 
Field Summary
 
Fields inherited from interface org.d2rq.db.vendor.Vendor
HSQLDB, InterbaseOrFirebird, log, MSAccess, MySQL, Oracle, PostgreSQL, SQL92, SQLServer, Sybase
 
Constructor Summary
PostgreSQL()
           
 
Method Summary
 DataType getDataType(int jdbcType, String name, int size)
          Returns a DataType corresponding to a JDBC type.
 String getTrueTable()
          For databases that support SQL queries without a FROM clause, (SELECT 1+1), this should return null.
 void initializeConnection(Connection connection)
          Vendor-specific initialization for a database connection.
 boolean isIgnoredTable(String catalog, String schema, String table)
          TODO Use the Filter interface for this
 String quoteBinaryLiteral(String hexString)
           
 TableName toQualifiedTableName(String catalog, String schema, String table)
          Returns a qualified table name from catalog/schema/table strings as reported from JDBC metadata.
 
Methods inherited from class org.d2rq.db.vendor.SQL92
booleanExpressionToSimpleExpression, getAliasOperator, getConcatenationExpression, getDefaultConnectionProperties, getRowNumLimitAsExpression, getRowNumLimitAsQueryAppendage, getRowNumLimitAsSelectModifier, parseIdentifiers, quoteDateLiteral, quoteStringLiteral, quoteTimeLiteral, quoteTimestampLiteral, toString, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostgreSQL

public PostgreSQL()
Method Detail

getTrueTable

public String getTrueTable()
Description copied from interface: Vendor
For databases that support SQL queries without a FROM clause, (SELECT 1+1), this should return null. For databases that require some sort of dummy table (e.g., Oracle: SELECT 1+1 FROM DUAL), this should return the name of that table.

Specified by:
getTrueTable in interface Vendor
Overrides:
getTrueTable in class SQL92

quoteBinaryLiteral

public String quoteBinaryLiteral(String hexString)
Specified by:
quoteBinaryLiteral in interface Vendor
Overrides:
quoteBinaryLiteral in class SQL92

getDataType

public DataType getDataType(int jdbcType,
                            String name,
                            int size)
Description copied from interface: Vendor
Returns a DataType corresponding to a JDBC type. This may be an unsupported datatype; in this case, its DataType.isUnsupported() method will return true. null will be returned if the vendor code doesn't handle this datatype at all; that should generally be considered a bug.

Specified by:
getDataType in interface Vendor
Overrides:
getDataType in class SQL92
Parameters:
jdbcType - A java.sql.Types constant
name - The type name, as reported by java.sql metadata methods, normalized to uppercase
size - Character size of the type, or 0 if not applicable
Returns:
A compatible D2RQ DataType instance, or null if the vendor code is broken

isIgnoredTable

public boolean isIgnoredTable(String catalog,
                              String schema,
                              String table)
Description copied from interface: Vendor
TODO Use the Filter interface for this

Specified by:
isIgnoredTable in interface Vendor
Overrides:
isIgnoredTable in class SQL92
Parameters:
catalog - A catalog name, or null for the connection's default schema
schema - A schema name, or null for the connection's default schema
table - A table name
Returns:
true if this is a system table that doesn't contain user/application data

toQualifiedTableName

public TableName toQualifiedTableName(String catalog,
                                      String schema,
                                      String table)
Description copied from interface: Vendor
Returns a qualified table name from catalog/schema/table strings as reported from JDBC metadata. Vendor implementations can override this to rename schemas, mess around with case sensitivity, etc.

Specified by:
toQualifiedTableName in interface Vendor
Overrides:
toQualifiedTableName in class SQL92
Parameters:
catalog - A catalog name, or null for the connection's default schema
schema - A schema name, or null for the connection's default schema
table - A table name
Returns:
A QualfiedTableName instance that names the table

initializeConnection

public void initializeConnection(Connection connection)
                          throws SQLException
Description copied from interface: Vendor
Vendor-specific initialization for a database connection.

Specified by:
initializeConnection in interface Vendor
Overrides:
initializeConnection in class SQL92
Throws:
SQLException