|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.test.MockCatalogReader
public class MockCatalogReader
Mock implementation of SqlValidatorCatalogReader
which returns tables
"EMP", "DEPT", "BONUS", "SALGRADE" (same as Oracle's SCOTT schema).
Nested Class Summary | |
---|---|
static class |
MockCatalogReader.MockSchema
|
static class |
MockCatalogReader.MockTable
Mock implementation of SqlValidatorTable . |
Field Summary | |
---|---|
private RelDataType |
addressType
|
protected static String |
defaultSchema
|
protected Map<String,MockCatalogReader.MockSchema> |
schemas
|
private Map<List<String>,MockCatalogReader.MockTable> |
tables
|
protected RelDataTypeFactory |
typeFactory
|
Constructor Summary | |
---|---|
|
MockCatalogReader(RelDataTypeFactory typeFactory)
Creates a MockCatalogReader. |
protected |
MockCatalogReader(RelDataTypeFactory typeFactory,
boolean dummy)
Creates a MockCatalogReader but does not initialize. |
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. |
protected void |
init()
Initializes this catalog reader. |
protected void |
registerSchema(MockCatalogReader.MockSchema schema)
|
protected void |
registerTable(MockCatalogReader.MockTable table)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String defaultSchema
protected final RelDataTypeFactory typeFactory
private final Map<List<String>,MockCatalogReader.MockTable> tables
protected final Map<String,MockCatalogReader.MockSchema> schemas
private RelDataType addressType
Constructor Detail |
---|
public MockCatalogReader(RelDataTypeFactory typeFactory)
typeFactory
- Type factoryprotected MockCatalogReader(RelDataTypeFactory typeFactory, boolean dummy)
Protected constructor for use by subclasses, which must call
init()
at the end of their public constructor.
typeFactory
- Type factorydummy
- Dummy parameter to distinguish from public constructorMethod Detail |
---|
protected void init()
protected void registerTable(MockCatalogReader.MockTable table)
protected void registerSchema(MockCatalogReader.MockSchema schema)
public SqlValidatorTable getTable(String[] names)
SqlValidatorCatalogReader
getTable
in interface SqlValidatorCatalogReader
names
- Name of table
public RelDataType getNamedType(SqlIdentifier typeName)
SqlValidatorCatalogReader
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.
getNamedType
in interface SqlValidatorCatalogReader
typeName
- Name of type
public List<SqlMoniker> getAllSchemaObjectNames(List<String> names)
SqlValidatorCatalogReader
getAllSchemaObjectNames
in interface SqlValidatorCatalogReader
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'
public String getSchemaName()
SqlValidatorCatalogReader
getSchemaName
in interface SqlValidatorCatalogReader
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |