org.eigenbase.sql.validate
Class DelegatingSqlValidatorCatalogReader

java.lang.Object
  extended by org.eigenbase.sql.validate.DelegatingSqlValidatorCatalogReader
All Implemented Interfaces:
SqlValidatorCatalogReader

public abstract class DelegatingSqlValidatorCatalogReader
extends Object
implements SqlValidatorCatalogReader

Implementation of SqlValidatorCatalogReader that passes all calls to a parent catalog reader.

Since:
Mar 6, 2009
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/DelegatingSqlValidatorCatalogReader.java#1 $
Author:
jhyde

Field Summary
protected  SqlValidatorCatalogReader catalogReader
           
 
Constructor Summary
DelegatingSqlValidatorCatalogReader(SqlValidatorCatalogReader catalogReader)
          Creates a DelegatingSqlValidatorCatalogReader.
 
Method Summary
 List<SqlMoniker> getAllSchemaObjectNames(List<String> names)
          Gets schema object names as specified.
 RelDataType getNamedType(SqlIdentifier typeName)
          Finds a user-defined type with the given name, possibly qualified.
 String getSchemaName()
          Returns the name of the current schema.
 SqlValidatorTable getTable(String[] names)
          Finds a table with the given name, possibly qualified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

catalogReader

protected final SqlValidatorCatalogReader catalogReader
Constructor Detail

DelegatingSqlValidatorCatalogReader

public DelegatingSqlValidatorCatalogReader(SqlValidatorCatalogReader catalogReader)
Creates a DelegatingSqlValidatorCatalogReader.

Parameters:
catalogReader - Parent catalog reader
Method Detail

getTable

public SqlValidatorTable getTable(String[] names)
Description copied from interface: SqlValidatorCatalogReader
Finds a table with the given name, possibly qualified.

Specified by:
getTable in interface SqlValidatorCatalogReader
Parameters:
names - Name of table
Returns:
named table, or null if not found

getNamedType

public RelDataType getNamedType(SqlIdentifier typeName)
Description copied from interface: SqlValidatorCatalogReader
Finds a user-defined type with the given name, possibly qualified.

NOTE jvs 12-Feb-2005: the reason this method is defined here instead of on RelDataTypeFactory is that it has to take into account context-dependent information such as SQL schema path, whereas a type factory is context-independent.

Specified by:
getNamedType in interface SqlValidatorCatalogReader
Parameters:
typeName - Name of type
Returns:
named type, or null if not found

getAllSchemaObjectNames

public List<SqlMoniker> getAllSchemaObjectNames(List<String> names)
Description copied from interface: SqlValidatorCatalogReader
Gets schema object names as specified. They can be schema or table object. If names array contain 1 element, return all schema names and all table names under the default schema (if that is set) If names array contain 2 elements, treat 1st element as schema name and return all table names in this schema

Specified by:
getAllSchemaObjectNames in interface SqlValidatorCatalogReader
Parameters:
names - the array contains either 2 elements representing a partially qualified object name in the format of 'schema.object', or an unqualified name in the format of 'object'
Returns:
the list of all object (schema and table) names under the above criteria

getSchemaName

public String getSchemaName()
Description copied from interface: SqlValidatorCatalogReader
Returns the name of the current schema.

Specified by:
getSchemaName in interface SqlValidatorCatalogReader
Returns:
name of the current schema