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
public static class ReflectiveSchema.Factory extends java.lang.Object implements SchemaFactory
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 calledEMPS
andDEPTS
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 Constructor Description Factory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Schema
create(SchemaPlus parentSchema, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> operand)
Creates a Schema.
-
-
-
Method Detail
-
create
public Schema create(SchemaPlus parentSchema, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> operand)
Description copied from interface:SchemaFactory
Creates a Schema.- Specified by:
create
in interfaceSchemaFactory
- Parameters:
parentSchema
- Parent schemaname
- Name of this schemaoperand
- The "operand" JSON property- Returns:
- Created schema
-
-