net.sf.farrago.ddl
Class DdlImportForeignSchemaStmt.ImportSink

java.lang.Object
  extended by net.sf.farrago.namespace.util.MedAbstractMetadataSink
      extended by net.sf.farrago.ddl.DdlImportForeignSchemaStmt.ImportSink
All Implemented Interfaces:
FarragoMedMetadataSink
Enclosing class:
DdlImportForeignSchemaStmt

private class DdlImportForeignSchemaStmt.ImportSink
extends MedAbstractMetadataSink

ImportSink implements FarragoMedMetadataSink by creating catalog descriptors for imported foreign tables and columns.


Field Summary
private  FarragoSessionDdlValidator ddlValidator
           
private  FarragoMedNameDirectory directory
           
private  DdlMedHandler medHandler
           
private  Map<String,FemBaseColumnSet> tableMap
           
 
Constructor Summary
DdlImportForeignSchemaStmt.ImportSink(FarragoSessionDdlValidator ddlValidator, FarragoMedMetadataQuery query, FarragoMedNameDirectory directory)
           
 
Method Summary
private  FemBaseColumnSet createTable(String tableName)
           
(package private)  void dropStragglers()
           
(package private)  Set getImportedTableNames()
           
private  void setStorageOptions(FemElementWithStorageOptions element, Properties props)
           
 boolean writeColumnDescriptor(String tableName, String columnName, int ordinal, RelDataType type, String remarks, String defaultValue, Properties properties)
          Writes a descriptor for a column.
 boolean writeObjectDescriptor(String name, String typeName, String remarks, Properties properties)
          Writes a generic descriptor for an object.
 
Methods inherited from class net.sf.farrago.namespace.util.MedAbstractMetadataSink
getTypeFactory, shouldInclude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ddlValidator

private final FarragoSessionDdlValidator ddlValidator

tableMap

private final Map<String,FemBaseColumnSet> tableMap

medHandler

private DdlMedHandler medHandler

directory

private FarragoMedNameDirectory directory
Constructor Detail

DdlImportForeignSchemaStmt.ImportSink

DdlImportForeignSchemaStmt.ImportSink(FarragoSessionDdlValidator ddlValidator,
                                      FarragoMedMetadataQuery query,
                                      FarragoMedNameDirectory directory)
Method Detail

writeObjectDescriptor

public boolean writeObjectDescriptor(String name,
                                     String typeName,
                                     String remarks,
                                     Properties properties)
Description copied from interface: FarragoMedMetadataSink
Writes a generic descriptor for an object. Some objects (such as columns) have more specific write methods.

Parameters:
name - unqualified object name
remarks - object description, or null for none
properties - storage options
Returns:
true if object was accepted; false if object was filtered out

writeColumnDescriptor

public boolean writeColumnDescriptor(String tableName,
                                     String columnName,
                                     int ordinal,
                                     RelDataType type,
                                     String remarks,
                                     String defaultValue,
                                     Properties properties)
Description copied from interface: FarragoMedMetadataSink
Writes a descriptor for a column.

Parameters:
tableName - unqualified table name
columnName - unqualified column name
ordinal - 0-based ordinal of column within table
type - column datatype
remarks - column description, or null for none
defaultValue - column default value, or null for none
properties - storage options
Returns:
true if object was accepted; false if object was filtered out

getImportedTableNames

Set getImportedTableNames()

dropStragglers

void dropStragglers()

createTable

private FemBaseColumnSet createTable(String tableName)

setStorageOptions

private void setStorageOptions(FemElementWithStorageOptions element,
                               Properties props)