Package org.apache.calcite.adapter.java
Class ReflectiveSchema
java.lang.Object
org.apache.calcite.schema.impl.AbstractSchema
org.apache.calcite.adapter.java.ReflectiveSchema
- All Implemented Interfaces:
Schema
- Direct Known Subclasses:
ReflectiveSchemaWithoutRowCount
Implementation of
Schema
that exposes the
public fields and methods in a Java object.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Factory that creates a schema by instantiating an object and looking at its public fields.Nested classes/interfaces inherited from interface org.apache.calcite.schema.Schema
Schema.TableType
-
Constructor Summary
-
Method Summary
Methods inherited from class org.apache.calcite.schema.impl.AbstractSchema
getExpression, getFunctionNames, getFunctions, getSubSchema, getSubSchemaMap, getSubSchemaNames, getTable, getTableNames, getType, getTypeMap, getTypeNames, isMutable, snapshot
-
Constructor Details
-
ReflectiveSchema
Creates a ReflectiveSchema.- Parameters:
target
- Object whose fields will be sub-objects of the schema
-
-
Method Details
-
toString
-
getTarget
Returns the wrapped object.May not appear to be used, but is used in generated code via
BuiltInMethod.REFLECTIVE_SCHEMA_GET_TARGET
. -
getTableMap
Description copied from class:AbstractSchema
Returns a map of tables in this schema by name.The implementations of
AbstractSchema.getTableNames()
andAbstractSchema.getTable(String)
depend on this map. The default implementation of this method returns the empty map. Override this method to change their behavior.- Overrides:
getTableMap
in classAbstractSchema
- Returns:
- Map of tables in this schema by name
-
getFunctionMultimap
Description copied from class:AbstractSchema
Returns a multi-map of functions in this schema by name. It is a multi-map because functions are overloaded; there may be more than one function in a schema with a given name (as long as they have different parameter lists).The implementations of
AbstractSchema.getFunctionNames()
andSchema.getFunctions(String)
depend on this map. The default implementation of this method returns the empty multi-map. Override this method to change their behavior.- Overrides:
getFunctionMultimap
in classAbstractSchema
- Returns:
- Multi-map of functions in this schema by name
-
getRowCount
-