Class ReflectiveSchema.Factory

All Implemented Interfaces:
Enclosing class:

public static class ReflectiveSchema.Factory extends 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 called EMPS and DEPTS based on the object's fields.

 schemas: [
       name: "foodmart",
       type: "custom",
       factory: "$Factory",
       operand: {
         class: "com.acme.FoodMart",
         staticMethod: "instance"
 class FoodMart {
   public static final FoodMart instance() {
     return new FoodMart();
   Employee[] EMPS;
   Department[] DEPTS;
  • Constructor Details

    • Factory

      public Factory()
  • Method Details

    • create

      public Schema create(SchemaPlus parentSchema, String name, Map<String,Object> operand)
      Description copied from interface: SchemaFactory
      Creates a Schema.
      Specified by:
      create in interface SchemaFactory
      parentSchema - Parent schema
      name - Name of this schema
      operand - The "operand" JSON property
      Created schema