Package org.apache.calcite.adapter.java
Class ReflectiveSchema.Factory
java.lang.Object
org.apache.calcite.adapter.java.ReflectiveSchema.Factory
- All Implemented Interfaces:
SchemaFactory
- Enclosing class:
ReflectiveSchema
Factory that creates a schema by instantiating an object and looking at
its public fields.
The following example instantiates a FoodMart object as a schema
that contains tables called EMPS and DEPTS based on the
object's fields.
schemas: [
{
name: "foodmart",
type: "custom",
factory: "org.apache.calcite.adapter.java.ReflectiveSchema$Factory",
operand: {
class: "com.acme.FoodMart",
staticMethod: "instance"
}
}
]
class FoodMart {
public static final FoodMart instance() {
return new FoodMart();
}
Employee[] EMPS;
Department[] DEPTS;
}-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
create
Description copied from interface:SchemaFactoryCreates a Schema.- Specified by:
createin interfaceSchemaFactory- Parameters:
parentSchema- Parent schemaname- Name of this schemaoperand- The "operand" JSON property- Returns:
- Created schema
-